diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-17 14:11:47 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-20 13:19:02 +0200 |
commit | 129dae5dbd0b4e51433a00b41282bcb8850fb2e3 (patch) | |
tree | 6d49faeec58f1ac2accb08d254ae14167da96632 | |
parent | 46438c91f71249d89b17fd80ec0a00cd9166c63e (diff) |
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>
-rw-r--r-- | cmake/QtFeature.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 2d200c0e2e..fc2fb8f529 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -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") |