diff options
author | Kai Koehne <kai.koehne@qt.io> | 2019-04-29 09:56:49 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2019-04-30 11:50:07 +0000 |
commit | ba4fdd99fff80790f764ab1ac8addd699e3101e7 (patch) | |
tree | 04c2624eebb10a97b1d9384cf143ac2fd2f4ff2d /mkspecs/features/data/cmake | |
parent | 9f1a1e320c118ec84d389aaf83008bf01521ce6f (diff) |
CMake: Ignore CMAKE_CXX_STANDARD_LIBRARIES in .prl files
Do not call find_library() on libs that are part of CMAKE_CXX_STANDARD_LIBRARIES:
At CMake call time they might not be found.
Fixes: QTBUG-73475
Change-Id: I350b3280744883e82d83c46e70f6a7cfc8aeed2e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'mkspecs/features/data/cmake')
-rw-r--r-- | mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index aca8703238..1c4994c30f 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -59,6 +59,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS[ \\t]*=\") string(REGEX REPLACE \"QMAKE_PRL_LIBS[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends ${_prl_strings}) string(REGEX REPLACE \"[ \\t]+\" \";\" _static_depends ${_static_depends}) + string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries ${CMAKE_CXX_STANDARD_LIBRARIES}) set(_search_paths) string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\") foreach(_flag ${_static_depends}) @@ -66,7 +67,15 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura if(_flag MATCHES \"^-l(.*)$\") # Handle normal libraries passed as -lfoo set(_lib \"${CMAKE_MATCH_1}\") - if(_lib MATCHES \"^pthread$\") + foreach(_standard_library ${_standard_libraries}) + if(_standard_library MATCHES \"^${_lib}(\\.lib)?$\") + set(_lib_is_default_linked TRUE) + break() + endif() + endforeach() + if (_lib_is_default_linked) + unset(_lib_is_default_linked) + elseif(_lib MATCHES \"^pthread$\") find_package(Threads REQUIRED) list(APPEND _lib_deps Threads::Threads) else() |