Mercurial > pub > dyncall > dyncall
annotate test/dynload_plain/CMakeLists.txt @ 313:73b5b9e224e2
- dynload_plain test: stability fix for picking right testing lib on build
author | Tassilo Philipp |
---|---|
date | Tue, 05 Nov 2019 15:19:16 +0100 |
parents | 7c6f19d42b31 |
children |
rev | line source |
---|---|
214 | 1 add_executable(dynload_plain dynload_plain.c) |
2 target_link_libraries(dynload_plain dynload_s ${CMAKE_DL_LIBS}) | |
308 | 3 file(WRITE x.c "int dynload_plain_testfunc() { return 5; }") |
4 add_library(x SHARED x.c) | |
5 set_target_properties(x PROPERTIES OUTPUT_NAME "dynload_plain_ß_test") | |
6 set_target_properties(x PROPERTIES PREFIX "") | |
7 set_target_properties(x PROPERTIES SUFFIX "") | |
274
5c8eb8f34ae6
- more make compat fixes for test/dynload_plain
Tassilo Philipp
parents:
272
diff
changeset
|
8 if(${UNIX}) |
313
73b5b9e224e2
- dynload_plain test: stability fix for picking right testing lib on build
Tassilo Philipp
parents:
308
diff
changeset
|
9 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) |
272
a94a9a83dae6
- dynload_plain test handling symbol aliases, now
Tassilo Philipp
parents:
214
diff
changeset
|
10 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEF_C_DYLIB=\\\"${DEF_C_DYLIB}\\\"") |
274
5c8eb8f34ae6
- more make compat fixes for test/dynload_plain
Tassilo Philipp
parents:
272
diff
changeset
|
11 endif() |
214 | 12 |