view test/dynload_plain/CMakeLists.txt @ 425:2d9f1cb06352

- dynload: corrected comparison of size of optional PE header info to what is pointed to (ptr arithmetic was incorrect, only broke ReactOS builds and runtime, though)
author Tassilo Philipp
date Fri, 17 Dec 2021 18:50:58 +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()