Skip to content

Commit 1cd373d

Browse files
committed
tests: Always link tree test with libm due to sqrt() and friends
1 parent f6652ee commit 1cd373d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
project (tests CXX)
22
set (OUTPUT_DIR ${CMAKE_BINARY_DIR})
33

4+
include (${PROJECT_SOURCE_DIR}/../cmake/PlatformDetect.cmake)
5+
plibsys_detect_target_os (PLIBSYS_TESTS_TARGET_OS)
6+
47
if (NOT PLIBSYS_TESTS_STATIC)
58
find_package (Boost COMPONENTS unit_test_framework REQUIRED)
69
include_directories (${Boost_INCLUDE_DIR})
@@ -158,6 +161,11 @@ add_executable (ptree_test ${PTREE_TEST_SRCS})
158161
target_link_libraries (ptree_test ${Boost_LIBRARIES} plibsys)
159162
set_target_properties (ptree_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
160163

164+
# QNX requires libm for sqrt() and friends
165+
if (PLIBSYS_TESTS_TARGET_OS STREQUAL qnx)
166+
target_link_libraries (ptree_test m)
167+
endif()
168+
161169
set (PTYPES_TEST_SRCS ptypes_test.cpp)
162170
add_executable (ptypes_test ${PTYPES_TEST_SRCS})
163171
target_link_libraries (ptypes_test ${Boost_LIBRARIES} plibsys)

0 commit comments

Comments
 (0)