Cache qt_config_compile_test results

Inside qt_config_compile_test we use two different calls:
check_cxx_source_compiles when given code, and try_compile when
given a project.

The former caches its results, while the latter does not, which means
that the try_compile calls are re-executed on each reconfigure.

Do what check_cxx_source_compiles does internally, and don't rerun
the try_compile calls if the results were computed once.

Change-Id: I2691ff08b7bb46c3fa60bbf5ed6278731c9b8e21
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexandru Croitor 2019-12-02 13:21:23 +01:00
parent 8dc49161bb
commit c800a62403

View File

@ -472,6 +472,10 @@ function(qt_feature_copy_global_config_features_to_core target)
endfunction()
function(qt_config_compile_test name)
if(DEFINED "TEST_${name}")
return()
endif()
cmake_parse_arguments(arg "" "LABEL;PROJECT_PATH;C_STANDARD;CXX_STANDARD" "LIBRARIES;CODE" ${ARGN})
if(arg_PROJECT_PATH)