diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-02-08 17:04:20 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-02-11 09:26:08 +0000 |
commit | 2ce3f440f9e53fc63c0dff63e2b6950a735f7cb1 (patch) | |
tree | 1b52ed6dd963612a8189f1da0d65af7f4d0b864b /cmake | |
parent | bb0deccf19116735db3724734b79b89d8dbdf2e3 (diff) |
Allow passing libraries to qt_config_compile_test
Fixes cxx11_future and ipc_posix tests
Change-Id: I0f3a7b1a0452724c07198a87c2fc25344e7451eb
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index aa18b380a6..f13f8d477a 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -385,9 +385,12 @@ function(qt_feature_module_end target) endfunction() function(qt_config_compile_test name) - cmake_parse_arguments(arg "" "LABEL" "" ${ARGN}) + cmake_parse_arguments(arg "" "LABEL" "LIBRARIES;CODE" ${ARGN}) - check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS}" HAVE_${name}) + set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}") + check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name}) + set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}") endfunction() |