Commit f0bda2c4 authored by Ghislain MARY's avatar Ghislain MARY

Check for libm when building with CMake.

parent 913e7484
......@@ -34,6 +34,8 @@ if(MSVC)
list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC)
endif()
include(CheckLibraryExists)
check_library_exists("m" "sqrt" "" HAVE_SQRT)
if(ENABLE_TESTS)
find_package(CUnit)
if(CUNIT_FOUND)
......
......@@ -42,4 +42,7 @@ else()
include_directories(${CUNIT_INCLUDE_DIR})
endif()
target_link_libraries(bzrtpTest ${CUNIT_LIBRARIES} bzrtp)
if(HAVE_SQRT)
target_link_libraries(bzrtpTest m)
endif()
add_test(NAME bzrtpTest COMMAND bzrtpTest)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment