summaryrefslogtreecommitdiffstats
path: root/cmake/QtPriHelpers.cmake
diff options
context:
space:
mode:
authorLi Xinwei <1326710505@qq.com>2021-07-16 16:28:32 +0800
committerLi Xinwei <1326710505@qq.com>2021-07-17 02:42:13 +0800
commit2915921ad2a79a4ce1651dc7297f6571788d1413 (patch)
tree40a9d028c382f7d8272d33291e6e15be131516e6 /cmake/QtPriHelpers.cmake
parent5ef5dce53bb9f25b79275d1a2d7087b3eabfa792 (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 Pick-to: 6.2 6.1 Change-Id: Ie82f10b088e2764396377726340509f24a4ae8e7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPriHelpers.cmake')
-rw-r--r--cmake/QtPriHelpers.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake
index cfb5e85dc6..233f7ea4a4 100644
--- a/cmake/QtPriHelpers.cmake
+++ b/cmake/QtPriHelpers.cmake
@@ -378,8 +378,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}"
@@ -391,7 +393,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}")
@@ -801,8 +803,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}"
@@ -814,7 +818,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}")