view test/dynload_plain/CMakeLists.txt @ 382:dd5d03483314

- dynload changes to support macos >= 11.0.1 "built-in dynamic linker cache of all system-provided libraries" (those dylibs are no longer present on the fs)" * dynload_plain test code changes to reflect this * note in doc - changed dynload_plain to not do inode-based tests on windows
author Tassilo Philipp
date Wed, 20 Jan 2021 13:49:43 +0100
parents 73b5b9e224e2
children
line wrap: on
line source

add_executable(dynload_plain dynload_plain.c)
target_link_libraries(dynload_plain dynload_s ${CMAKE_DL_LIBS})
file(WRITE x.c "int dynload_plain_testfunc() { return 5; }")
add_library(x SHARED x.c)
set_target_properties(x PROPERTIES OUTPUT_NAME "dynload_plain_ß_test")
set_target_properties(x PROPERTIES PREFIX "")
set_target_properties(x PROPERTIES SUFFIX "")
if(${UNIX})
exec_program("((ldd `which ls` | grep -o '/.*/libc.so[^ ]*' || ls /lib*/libc.so* || ls /usr/lib/libc.so*) | grep -v '\\.a\$' | (sort -V -r || sort -t . -n -k 2)) 2>/dev/null | head -1" OUTPUT_VARIABLE DEF_C_DYLIB)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEF_C_DYLIB=\\\"${DEF_C_DYLIB}\\\"")
endif()