annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
214
Tassilo Philipp
parents:
diff changeset
1 add_executable(dynload_plain dynload_plain.c)
Tassilo Philipp
parents:
diff changeset
2 target_link_libraries(dynload_plain dynload_s ${CMAKE_DL_LIBS})
308
7c6f19d42b31 dynload UTF-8 support for library paths:
Tassilo Philipp
parents: 274
diff changeset
3 file(WRITE x.c "int dynload_plain_testfunc() { return 5; }")
7c6f19d42b31 dynload UTF-8 support for library paths:
Tassilo Philipp
parents: 274
diff changeset
4 add_library(x SHARED x.c)
7c6f19d42b31 dynload UTF-8 support for library paths:
Tassilo Philipp
parents: 274
diff changeset
5 set_target_properties(x PROPERTIES OUTPUT_NAME "dynload_plain_ß_test")
7c6f19d42b31 dynload UTF-8 support for library paths:
Tassilo Philipp
parents: 274
diff changeset
6 set_target_properties(x PROPERTIES PREFIX "")
7c6f19d42b31 dynload UTF-8 support for library paths:
Tassilo Philipp
parents: 274
diff changeset
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
Tassilo Philipp
parents:
diff changeset
12