Pass CMAKE compiler flags to arch detection

This fixes the detection of always available architecture based on
user set CMAKE flags.

Change-Id: I541ac9569766a0fe05f4395c06f2ee3bcd77b035
Fixes: QTBUG-91090
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2021-09-17 14:11:47 +02:00
parent 46438c91f7
commit 129dae5dbd

View File

@ -945,6 +945,16 @@ function(qt_get_platform_try_compile_vars out_var)
# Use the regular variables that are used for source-based try_compile() calls.
set(flags "${CMAKE_TRY_COMPILE_PLATFORM_VARIABLES}")
# Pass custom flags.
list(APPEND flags "CMAKE_C_FLAGS")
list(APPEND flags "CMAKE_C_FLAGS_DEBUG")
list(APPEND flags "CMAKE_C_FLAGS_RELEASE")
list(APPEND flags "CMAKE_C_FLAGS_RELWITHDEBINFO")
list(APPEND flags "CMAKE_CXX_FLAGS")
list(APPEND flags "CMAKE_CXX_FLAGS_DEBUG")
list(APPEND flags "CMAKE_CXX_FLAGS_RELEASE")
list(APPEND flags "CMAKE_CXX_FLAGS_RELWITHDEBINFO")
# Pass toolchain files.
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND flags "CMAKE_TOOLCHAIN_FILE")