diff options
author | Li Xinwei <1326710505@qq.com> | 2021-07-16 16:28:32 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-17 04:01:01 +0000 |
commit | e54d6459d246a167befcea1a39b162ecd49642a4 (patch) | |
tree | 3865584b5a1f8b4433ffb1ff3c9367f0d23f6073 /cmake/QtPriHelpers.cmake | |
parent | 2e480cdc6efaee42f80b13d2640b325e09b598e3 (diff) |
Fix generated pri and prl files
Quote the paths after "-L".
Get MSVC’s implicit link directories from $ENV{LIB}.
Fix some issues cause by Inconsistent case.
Amends 2c49f85380d7ad79d9473e0f42e7afaa36d31af9
Fixes: QTBUG-95198
Change-Id: Ie82f10b088e2764396377726340509f24a4ae8e7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2915921ad2a79a4ce1651dc7297f6571788d1413)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake/QtPriHelpers.cmake')
-rw-r--r-- | cmake/QtPriHelpers.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake index abe03031ad..2223b14680 100644 --- a/cmake/QtPriHelpers.cmake +++ b/cmake/QtPriHelpers.cmake @@ -379,8 +379,10 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features ${CMAKE_STATIC_LIBRARY_SUFFIX}) if(MSVC) set(link_library_flag "-l") + file(TO_CMAKE_PATH "$ENV{LIB};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" implicit_link_directories) else() set(link_library_flag ${CMAKE_LINK_LIBRARY_FLAG}) + set(implicit_link_directories ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) endif() add_custom_command( OUTPUT "${private_pri_file_path}" @@ -392,7 +394,7 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features "-DLIBRARY_SUFFIXES=${library_suffixes}" "-DLINK_LIBRARY_FLAG=${link_library_flag}" "-DCONFIGS=${configs}" - "-DIMPLICIT_LINK_DIRECTORIES=${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" + "-DIMPLICIT_LINK_DIRECTORIES=${implicit_link_directories}" -P "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake" VERBATIM) add_custom_target(${target}_lib_pri DEPENDS "${private_pri_file_path}") @@ -792,8 +794,10 @@ CONFIG += ${private_config_joined} ${CMAKE_STATIC_LIBRARY_SUFFIX}) if(MSVC) set(link_library_flag "-l") + file(TO_CMAKE_PATH "$ENV{LIB};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" implicit_link_directories) else() set(link_library_flag ${CMAKE_LINK_LIBRARY_FLAG}) + set(implicit_link_directories ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) endif() add_custom_command( OUTPUT "${qmodule_pri_target_path}" @@ -805,7 +809,7 @@ CONFIG += ${private_config_joined} "-DLIBRARY_SUFFIXES=${library_suffixes}" "-DLINK_LIBRARY_FLAG=${link_library_flag}" "-DCONFIGS=${configs}" - "-DIMPLICIT_LINK_DIRECTORIES=${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" + "-DIMPLICIT_LINK_DIRECTORIES=${implicit_link_directories}" -P "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake" VERBATIM) add_custom_target(qmodule_pri DEPENDS "${qmodule_pri_target_path}") |