mirror of
https://github.com/BlackMATov/curly.hpp.git
synced 2025-12-13 03:29:37 +07:00
69 lines
1.8 KiB
CMake
69 lines
1.8 KiB
CMake
project(curly.hpp.untests)
|
|
|
|
#
|
|
# coverage
|
|
#
|
|
|
|
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
|
|
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
|
|
set(COVERAGE_FLAGS "--coverage")
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
|
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
|
|
endif()
|
|
|
|
#
|
|
# executable
|
|
#
|
|
|
|
file(GLOB_RECURSE UNTESTS_SOURCES "*.cpp" "*.hpp")
|
|
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
|
|
target_link_libraries(${PROJECT_NAME} curly.hpp)
|
|
|
|
target_compile_options(${PROJECT_NAME}
|
|
PRIVATE
|
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
|
-Wno-c++98-compat
|
|
-Wno-c++98-compat-pedantic
|
|
-Wno-ctad-maybe-unsupported
|
|
-Wno-padded
|
|
-Wno-unknown-warning-option
|
|
-Wno-weak-vtables
|
|
-Wno-zero-as-null-pointer-constant
|
|
>)
|
|
|
|
add_test(${PROJECT_NAME} ${PROJECT_NAME})
|
|
|
|
#
|
|
# tencent/rapidjson
|
|
#
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
tencent_rapidjson
|
|
GIT_REPOSITORY https://github.com/tencent/rapidjson)
|
|
|
|
FetchContent_GetProperties(tencent_rapidjson)
|
|
if(NOT tencent_rapidjson_POPULATED)
|
|
FetchContent_Populate(tencent_rapidjson)
|
|
target_include_directories(${PROJECT_NAME}
|
|
PRIVATE ${tencent_rapidjson_SOURCE_DIR}/include)
|
|
endif()
|
|
|
|
#
|
|
# blackmatov/promise.hpp
|
|
#
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
blackmatov_promise_hpp
|
|
GIT_REPOSITORY https://github.com/blackmatov/promise.hpp
|
|
GIT_TAG origin/main)
|
|
|
|
FetchContent_GetProperties(blackmatov_promise_hpp)
|
|
if(NOT blackmatov_promise_hpp_POPULATED)
|
|
FetchContent_Populate(blackmatov_promise_hpp)
|
|
target_include_directories(${PROJECT_NAME}
|
|
PRIVATE ${blackmatov_promise_hpp_SOURCE_DIR}/headers)
|
|
endif()
|