mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-21 08:21:15 +00:00
cmake: use 'LINKER:SHELL:' prefix for detecting version script support
This commit is contained in:
committed by
Sam Lantinga
parent
71b9adda21
commit
9228b91da2
@@ -558,7 +558,7 @@ endif()
|
||||
|
||||
check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT)
|
||||
if(HAVE_WL_VERSION_SCRIPT)
|
||||
sdl_shared_link_options("-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym")
|
||||
sdl_shared_link_options("LINKER:SHELL:--version-script \"${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym\"")
|
||||
else()
|
||||
# When building with tcc on Linux+glibc or Android, avoid emitting an error
|
||||
# for lack of support of the version-script linker flag: the option will be
|
||||
|
||||
@@ -316,7 +316,7 @@ function(check_linker_supports_version_file VAR)
|
||||
else()
|
||||
cmake_push_check_state(RESET)
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/dummy.sym" "n_0 {\n global:\n func;\n local: *;\n};\n")
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/dummy.sym")
|
||||
list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "LINKER:SHELL:--version-script \"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/dummy.sym\"")
|
||||
check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" ${VAR} FAIL_REGEX "(unsupported|syntax error|unrecognized option)")
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user