From 8fbefc7e097415ebd2b7bdf5e5b3f1e798ad909f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GUEZO?= Date: Mon, 23 Jun 2025 00:26:03 +0200 Subject: [PATCH] fix(cmakelists.txt): remove -lm for msvc compilation --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1acd92b..5695373 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,10 @@ file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.c) file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS src/*.h) add_executable(main ${SOURCES} ${HEADERS}) -target_link_libraries(main m) +if(NOT MSVC) + target_link_libraries(main m) +endif() + # ==== tests ==== enable_testing() @@ -17,6 +20,8 @@ list(FILTER SOURCES EXCLUDE REGEX ".*src/main\\.c$") if(TEST_SOURCES) add_executable(tests ${TEST_SOURCES} ${SOURCES}) - target_link_libraries(tests m) + if(NOT MSVC) + target_link_libraries(tests m) + endif() add_test(NAME tests COMMAND tests) endif()