Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ option(PISTACHE_ENABLE_NETWORK_TESTS "if tests are built, run ones needing netwo
option(PISTACHE_USE_SSL "add support for SSL server" OFF)
option(PISTACHE_PIC "Enable pistache PIC" ON) # Position-independent code lib
option(PISTACHE_BUILD_FUZZ "Build fuzzer for oss-fuzz" OFF)
option(PISTACHE_USE_RAPIDJSON "add support for rapidjson" ON)

string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" CMAKE_HOST_SYSTEM_NAME_LOWER)

Expand Down Expand Up @@ -102,6 +103,10 @@ add_subdirectory (src)
# For info on GTest::gtest GTest::gmock_main, see Pistache's
# tests/CMakeLists.txt
if (PISTACHE_BUILD_TESTS)
if (NOT PISTACHE_USE_RAPIDJSON)
message(FATAL_ERROR "Pistache tests require rapidjson support")
endif()

include(CTest)
find_package(GTest QUIET)
if (NOT GTEST_FOUND)
Expand All @@ -123,7 +128,7 @@ if (PISTACHE_BUILD_TESTS)
add_subdirectory(tests)
endif()

if (PISTACHE_BUILD_FUZZ)
if (PISTACHE_BUILD_FUZZ)
add_subdirectory(tests/fuzzers)
endif()

Expand Down
40 changes: 21 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,28 @@ set(PISTACHE_INCLUDE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)

find_package(RapidJSON QUIET)
if (NOT RapidJSON_FOUND)
message("RapidJSON not found. Consider installing it on your system. Downloading it from source...")
include(FetchContent)
FetchContent_Declare(
RapidJSON
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
GIT_TAG v1.1.0
GIT_SHALLOW true
)
set(RAPIDJSON_BUILD_DOC OFF CACHE BOOL "")
set(RAPIDJSON_BUILD_EXAMPLES OFF CACHE BOOL "")
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "")
if(NOT RapidJSON_POPULATED)
FetchContent_Populate(RapidJSON)
add_subdirectory(${rapidjson_SOURCE_DIR} ${rapidjson_BINARY_DIR})
if (PISTACHE_USE_RAPIDJSON)
find_package(RapidJSON QUIET)
if (NOT RapidJSON_FOUND)
message("RapidJSON not found. Consider installing it on your system. Downloading it from source...")
include(FetchContent)
FetchContent_Declare(
RapidJSON
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
GIT_TAG v1.1.0
GIT_SHALLOW true
)
set(RAPIDJSON_BUILD_DOC OFF CACHE BOOL "")
set(RAPIDJSON_BUILD_EXAMPLES OFF CACHE BOOL "")
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "")
if(NOT RapidJSON_POPULATED)
FetchContent_Populate(RapidJSON)
add_subdirectory(${rapidjson_SOURCE_DIR} ${rapidjson_BINARY_DIR})
endif()
target_include_directories(pistache PRIVATE ${rapidjson_SOURCE_DIR}/include)
else()
target_include_directories(pistache PRIVATE ${RAPIDJSON_INCLUDE_DIRS})
endif()
target_include_directories(pistache PRIVATE ${rapidjson_SOURCE_DIR}/include)
else()
target_include_directories(pistache PRIVATE ${RAPIDJSON_INCLUDE_DIRS})
endif()

target_include_directories(pistache PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/hinnant-date/include)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.6.20250328
0.5.6.20250429