update cmake

This commit is contained in:
ado 2021-02-07 12:15:53 +01:00
parent 9408c385d6
commit e366618639
2 changed files with 12 additions and 1 deletions

View File

@ -16,6 +16,16 @@ if(ssp_INCLUDE_WITHOUT_SYSTEM)
set(ssp_warning_guard "")
endif()
# ---- Dependencies ----
FetchContent_Declare(
fast_float
GIT_REPOSITORY https://github.com/red0124/fast_float.git
GIT_TAG origin/meson
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(fast_float)
# ---- Declare library ----
add_library(ssp INTERFACE)
@ -26,6 +36,7 @@ target_include_directories(
${ssp_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
fast_float
)
target_compile_features(ssp INTERFACE cxx_std_17)

View File

@ -30,7 +30,7 @@ enable_testing()
foreach(name IN ITEMS test_splitter test_parser test_converter test_extractions)
add_executable("${name}" "${name}.cpp")
target_link_libraries("${name}" PRIVATE ssp::ssp doctest::doctest)
target_link_libraries("${name}" PRIVATE ssp::ssp fast_float doctest::doctest)
target_compile_definitions("${name}" PRIVATE
DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI)
doctest_discover_tests("${name}")