Adding BillySheet as a library

This commit is contained in:
Pcornat 2024-10-30 17:04:49 +01:00
parent 40f692ea5e
commit 1f18499228
Signed by: Pcornat
GPG Key ID: E0326CC678A00BDD
2 changed files with 4 additions and 5 deletions

View File

@ -77,8 +77,6 @@ if (${ENABLE_COVERAGE})
list(APPEND LINKER_FLAGS gcov) list(APPEND LINKER_FLAGS gcov)
endif () endif ()
add_subdirectory("Unit testing")
add_library(BillySheet SHARED ${SOURCES}) add_library(BillySheet SHARED ${SOURCES})
target_include_directories(BillySheet PRIVATE include include/imgui external/ImFileDialog) target_include_directories(BillySheet PRIVATE include include/imgui external/ImFileDialog)
@ -117,3 +115,5 @@ target_link_libraries(BillySheet glfw
nlohmann_json::nlohmann_json nlohmann_json::nlohmann_json
${LINKER_FLAGS} ${LINKER_FLAGS}
) )
add_subdirectory("Unit testing")

View File

@ -6,7 +6,6 @@ include(../external/catch2/extras/Catch.cmake)
add_executable(UnitTest adummy.cpp add_executable(UnitTest adummy.cpp
characteristics_tests.cpp characteristics_tests.cpp
../src/billy_objects.cpp
billy_objects_tests.cpp billy_objects_tests.cpp
) )
@ -19,9 +18,9 @@ set_target_properties(Catch2 UnitTest svector PROPERTIES
) )
target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include) target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_compile_definitions(UnitTest PRIVATE ${DEF_COMP}) target_compile_definitions(UnitTest PRIVATE ${DEF_COMP})
target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS}) target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS} -fdiagnostics-all-candidates)
target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS}) target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS})
target_link_libraries(UnitTest ${LINKER_FLAGS} spdlog::spdlog_header_only Catch2::Catch2WithMain nlohmann_json::nlohmann_json svector::svector) target_link_libraries(UnitTest ${LINKER_FLAGS} spdlog::spdlog_header_only Catch2::Catch2WithMain nlohmann_json::nlohmann_json svector::svector BillySheet)
enable_testing() enable_testing()
catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml) catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml)