diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-26 20:45:11 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-29 12:47:59 +0200 |
commit | 943340222e841904707dc4f3e08f0df57d2e5c28 (patch) | |
tree | ddafe167749aeb63dfc7c806a5aabc9e5c50df21 /cmake/QtFeature.cmake | |
parent | 8df4caf554e81e7de9e0154a15544426e99acbbc (diff) |
CMake: Generate qdevice.pri when cross-building
This adds the CMake equivalent to the classical -device-option key=value
configure argument:
-DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN]
The keys and values get dumped verbatim into qdevice.pri.
This patch also ports the machineTuple configure test. Its result is
written into qdevice.pri as value for the GCC_MACHINE_DUMP variable.
Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index c0e1313a45..bdbdae9611 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -858,6 +858,25 @@ function(qt_config_compile_test_x86simd extension label) set(TEST_subarch_${extension} "${TEST_X86SIMD_${extension}}" CACHE INTERNAL "${label}") endfunction() +function(qt_config_compile_test_machine_tuple label) + if(DEFINED TEST_MACHINE_TUPLE OR NOT (GCC OR CLANG)) + return() + endif() + + message(STATUS "Performing Test ${label}") + execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -dumpmachine + OUTPUT_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE exit_code) + if(exit_code EQUAL 0) + set(status_label "Success") + else() + set(status_label "Failed") + endif() + message(STATUS "Performing Test ${label} - ${status_label}") + set(TEST_machine_tuple "${output}" CACHE INTERNAL "${label}") +endfunction() + function(qt_make_features_available target) if(NOT "${target}" MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-Z0-9_-]*$") message(FATAL_ERROR "${target} does not match ${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-Z0-9_-]*. INVALID NAME.") |