From 595ac662ed707bf56162c6234a3f52895f6b0502 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 13 Mar 2023 17:45:42 +0100 Subject: [PATCH] CMake: Pass CMAKE_EXE_LINKER_FLAGS to project-based try_compile CMake does it for non-project-based try_compile calls if the CMP0056 policy is set to NEW. That was introduced in CMake 3.2, thus set it unconditionally. The use case is to pick up custom -rpath-link paths when cross-compiling. Pick-to: 6.4 6.5 Change-Id: I726b90267dd46de116052b5b7f19b9354a568200 Reviewed-by: Dimitrios Apostolou Reviewed-by: Joerg Bornemann --- cmake/QtFeature.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index e61b13d0608..199b844cf89 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -1007,6 +1007,7 @@ function(qt_get_platform_try_compile_vars out_var) list(APPEND flags "CMAKE_CXX_FLAGS_RELEASE") list(APPEND flags "CMAKE_CXX_FLAGS_RELWITHDEBINFO") list(APPEND flags "CMAKE_OBJCOPY") + list(APPEND flags "CMAKE_EXE_LINKER_FLAGS") # Pass toolchain files. if(CMAKE_TOOLCHAIN_FILE)