mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-01 01:46:23 +00:00
Fix CUnit symbols checking in CMake.
This commit is contained in:
parent
15dcfa4071
commit
e76b7423b8
1 changed files with 7 additions and 3 deletions
|
|
@ -55,7 +55,7 @@ cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENAB
|
|||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules)
|
||||
|
||||
include(CheckIncludeFile)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
if(MSVC)
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC)
|
||||
|
|
@ -67,8 +67,12 @@ find_package(XML2 REQUIRED)
|
|||
if(ENABLE_UNIT_TESTS)
|
||||
find_package(CUnit)
|
||||
if(CUNIT_FOUND)
|
||||
check_library_exists("cunit" "CU_get_suite" "" HAVE_CU_GET_SUITE)
|
||||
check_library_exists("cunit" "CU_curses_run_tests" "" HAVE_CU_CURSES)
|
||||
cmake_push_check_state(RESET)
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${CUNIT_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CUNIT_LIBRARIES})
|
||||
check_symbol_exists("CU_get_suite" "CUnit/CUnit.h" HAVE_CU_GET_SUITE)
|
||||
check_symbol_exists("CU_curses_run_tests" "CUnit/CUnit.h" HAVE_CU_CURSES)
|
||||
cmake_pop_check_state()
|
||||
else()
|
||||
message(WARNING "Could not find the cunit library!")
|
||||
set(ENABLE_UNIT_TESTS OFF CACHE BOOL "Enable compilation of unit tests." FORCE)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue