Mercurial > pub > dyncall > dyncall
view test/dynload_plain/CMakeLists.txt @ 410:7608e34098b0
- cleanups, simplifications, some api clarification, ...
- test cases consistency:
* return status code depending on test results (for actual conformance tests, not stuff that is not an example or hack to check something, ..)
* platform init helper added for some
author | Tassilo Philipp |
---|---|
date | Tue, 05 Oct 2021 21:53:04 +0200 |
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()