Skip to content

Commit 3cf1322

Browse files
committed
cmake: build with libm
1 parent 8c24def commit 3cf1322

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set_target_properties(clar PROPERTIES
2020
C_EXTENSIONS OFF
2121
)
2222

23+
if(NOT WIN32)
24+
set(CLAR_LIBRARIES m)
25+
endif()
26+
2327
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
2428
include(CTest)
2529
if(BUILD_TESTING)

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ target_include_directories(example PRIVATE
2525
"${CMAKE_SOURCE_DIR}"
2626
"${CMAKE_CURRENT_BINARY_DIR}"
2727
)
28-
target_link_libraries(example clar)
28+
target_link_libraries(example clar ${CLAR_LIBRARIES})

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ target_include_directories(selftest PRIVATE
3838
"${CMAKE_SOURCE_DIR}"
3939
"${CMAKE_CURRENT_BINARY_DIR}"
4040
)
41-
target_link_libraries(selftest clar)
41+
target_link_libraries(selftest clar ${CLAR_LIBRARIES})
4242

4343
add_test(NAME build_selftest_suite
4444
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --target selftest_suite

test/selftest_suite/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ target_include_directories(selftest_suite PRIVATE
3737
"${CMAKE_SOURCE_DIR}"
3838
"${CMAKE_CURRENT_BINARY_DIR}"
3939
)
40-
target_link_libraries(selftest_suite clar)
40+
target_link_libraries(selftest_suite clar ${CLAR_LIBRARIES})

0 commit comments

Comments
 (0)