summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-08-03 14:54:10 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-08-04 19:40:51 +0200
commit0125e48ce0cc9a7d5c81f59855173fdd998d34df (patch)
tree9b29cedea6a9fba306dbcc5cc4b9001753841d2a /cmake/QtBuild.cmake
parente3e6d58cadefbe55160535679d8b6c93c72e8e3e (diff)
CMake: Don't generate prl libs for Windows shared libs
Windows shared library prl files should not have a QMAKE_PRL_LIBS section. Such information is not useful because it's not used by the linker as per 523c7e3fd55c853dd424d57f28e225d57439cf89 Amends 46d7abc9172f82756ccd3641a314dcc066353c3f Task-number: QTBUG-85240 Task-number: QTBUG-85801 Change-Id: Ic40491a568f72c507a16322f6f0c61f98d3a5913 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake22
1 files changed, 15 insertions, 7 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index e20985c2a3..f957d87332 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -3325,12 +3325,11 @@ function(qt_generate_prl_file target install_dir)
unset(rcc_objects)
endif()
- unset(prl_libs)
- qt_collect_libs(${target} prl_libs)
-
unset(prl_config)
+ set(is_static FALSE)
if(target_type STREQUAL "STATIC_LIBRARY")
list(APPEND prl_config static)
+ set(is_static TRUE)
elseif(target_type STREQUAL "SHARED_LIBRARY")
list(APPEND prl_config shared)
endif()
@@ -3387,16 +3386,25 @@ function(qt_generate_prl_file target install_dir)
# Generate the prl content and its final file name into configuration specific files
# whose names we know, and can be used in add_custom_command.
- file(GENERATE
- OUTPUT "${prl_step1_path}"
- CONTENT
+ set(prl_step1_content
"RCC_OBJECTS = ${rcc_objects}
QMAKE_PRL_BUILD_DIR = ${CMAKE_CURRENT_BINARY_DIR}
QMAKE_PRL_TARGET = $<TARGET_FILE_NAME:${target}>
QMAKE_PRL_CONFIG = ${prl_config}
QMAKE_PRL_VERSION = ${PROJECT_VERSION}
-QMAKE_PRL_LIBS_FOR_CMAKE = ${prl_libs}
")
+ if(NOT is_static AND WIN32)
+ # Do nothing. Prl files for shared libraries on Windows shouldn't have the libs listed,
+ # as per qt_build_config.prf and the conditional CONFIG+=explicitlib assignment.
+ else()
+ set(prl_libs "")
+ qt_collect_libs(${target} prl_libs)
+ string(APPEND prl_step1_content "QMAKE_PRL_LIBS_FOR_CMAKE = ${prl_libs}\n")
+ endif()
+
+ file(GENERATE
+ OUTPUT "${prl_step1_path}"
+ CONTENT "${prl_step1_content}")
file(GENERATE
OUTPUT "${prl_meta_info_path}"
CONTENT