Skip to content

Commit

Permalink
Conditional cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
yangosoft committed Dec 25, 2024
1 parent 9fdfe1f commit 0699caf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -120,7 +120,16 @@ target_include_directories( test_cpputils2
${CMAKE_CURRENT_SOURCE_DIR}/source
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_link_libraries(test_cpputils2 PRIVATE GTest::gtest_main rt spdlog::spdlog)

set(TEST_LIBS GTest::gtest GTest::gtest_main spdlog::spdlog)

if (WIN32)
list(APPEND TEST_LIBS ws2_32)
else()
list(APPEND TEST_LIBS rt)
endif()

target_link_libraries(test_cpputils2 PRIVATE cpputils2 ${TEST_LIBS})
include(CTest)

#add_test(CppUtils2Test test_cpputils2 --gtest_output=xml)

0 comments on commit 0699caf

Please sign in to comment.