Skip to content

Commit 71a883c

Browse files
committed
Fix the test for recent enough check.
1 parent a4c7381 commit 71a883c

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include(CheckSymbolExists)
1+
include(CheckCSourceCompiles)
22
find_package(PkgConfig)
33

44
pkg_search_module(CHECK check)
@@ -17,8 +17,15 @@ if(NOT CHECK_FOUND)
1717
endif()
1818

1919
if(CHECK_FOUND)
20-
set(CMAKE_REQUIRED_INCLUDE ${CHECK_INCLUDE_DIRS})
21-
CHECK_SYMBOL_EXISTS(ck_assert_ptr_ne "check.h" CHECK_FUNCS)
20+
set(CMAKE_REQUIRED_FLAGS ${CHECK_C_FLAGS} ${CHECK_LDFLAGS_OTHERS})
21+
set(CMAKE_REQUIRED_INCLUDES ${CHECK_INCLUDE_DIRS})
22+
set(CMAKE_REQUIRED_LIBRARIES ${CHECK_LIBRARIES})
23+
CHECK_C_SOURCE_COMPILES(
24+
"#include <check.h>
25+
int main() {
26+
ck_assert_ptr_ne(NULL, NULL);
27+
}"
28+
CHECK_FUNCS)
2229
if (NOT CHECK_FUNCS)
2330
set(CHECK_FOUND 0)
2431
endif()

0 commit comments

Comments
 (0)