diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBaseConfigureTests.cmake | 8 | ||||
-rw-r--r-- | cmake/QtBaseGlobalTargets.cmake | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index ae16e8e53b..618554e16c 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -118,6 +118,13 @@ VERS_1; set(CMAKE_REQUIRED_FLAGS "") endif() set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=\"${CMAKE_CURRENT_BINARY_DIR}/version_flag.map\"") + + # Pass the linker that the main project uses to the version script compile test. + qt_internal_get_active_linker_flags(linker_flags) + if(linker_flags) + set(CMAKE_REQUIRED_LINK_OPTIONS ${linker_flags}) + endif() + check_cxx_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT) if(DEFINED CMAKE_REQUIRED_FLAGS_SAVE) set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) @@ -164,7 +171,6 @@ endfunction() function(qt_run_qtbase_config_tests) qt_run_config_test_architecture() - qt_run_linker_version_script_support() qt_internal_ensure_latest_win_nt_api() endfunction() diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index c8499e3921..8cc19ac030 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -107,6 +107,11 @@ endif() qt_feature_module_end(GlobalConfig OUT_VAR_PREFIX "__GlobalConfig_") +# The version script support check has to happen after we determined which linker is going +# to be used. The linker decision happens in the qtbase/configure.cmake file that is processed +# above. +qt_run_linker_version_script_support() + qt_generate_global_config_pri_file() qt_generate_global_module_pri_file() qt_generate_global_device_pri_file() |