diff options
author | Li Xinwei <1326710505@qq.com> | 2021-07-26 17:09:20 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-29 11:51:06 +0000 |
commit | 2e2dd548b9f313b24c7b183536f024fe275c6f4b (patch) | |
tree | 628e0ffe9ce96c681db5c9b76df6606ab14c3212 /src | |
parent | 61ac05fa449083fea4b35b14d233802caab050a8 (diff) |
QtWebEngineProcess: fix installation
In 09e5da6ac44c01ae0de34b789c42da515e82f07c, we pass "NO_INSTALL" to
qt_internal_add_executable(), so we have to handle some installation
issues manually.
Use qt_get_cmake_configurations() instead of get_install_config().
Because get_install_config() only returns the first config in a
multi-config build, this causes the debug executable not installed.
We can install the debug executable to ${INSTALL_LIBEXECDIR}/Debug, like
other executables, to avoid conflict with the release executable. But
this will make installation codes very complex. So I propose to restore
Qt5's behavior for it , add a "d" suffix to the debug executable and
install both executables to ${INSTALL_LIBEXECDIR}. This can also avoid
breaking windeployqt's logic of finding the debug executable of
QtWebEngineProcess.
Also adjust the output directory property to place executables under the
correct directory. The release executable should be placed under
${QT_BUILD_DIR}/bin rather than ${QT_BUILD_DIR}/bin/Release. Given that
the debug executable now has a "d" suffix, it can also be placed under
the same directory.
And install PDB files manually because QtWebEngineProcessd.pdb should be
installed to ${INSTALL_LIBEXECDIR}, but qt_internal_install_pdb_files()
will install it to ${INSTALL_LIBEXECDIR}/Debug.
Change-Id: I38b5e8d9ed939b88de86ab5722dd56777442ed03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 7846457b067491ffb289e625282b1e89074253ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/process/CMakeLists.txt | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 995c32475..783a3b03a 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -70,6 +70,10 @@ foreach(arch ${GN_ARCHITECTURES}) get_forward_declaration_macro(forwardDeclarationMacro) get_target_property(qtWebEngineProcessName WebEngineCore QTWEBENGINEPROCESS_NAME) + if(QT_FEATURE_debug_and_release AND ("${config}" STREQUAL "Debug")) + set(qtWebEngineProcessName "${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}") + endif() + set(gnCxxCompileOptions "") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # Silence warning in boringssl headers. diff --git a/src/process/CMakeLists.txt b/src/process/CMakeLists.txt index 6d35d632c..3afdcc9bc 100644 --- a/src/process/CMakeLists.txt +++ b/src/process/CMakeLists.txt @@ -28,7 +28,18 @@ target_link_libraries(${qtWebEngineProcessName} ) target_include_directories(${qtWebEngineProcessName} PRIVATE ../core) -get_install_config(config) + +qt_get_cmake_configurations(configs) +foreach(config ${configs}) + string(TOUPPER "${config}" config_upper) + set_target_properties(${qtWebEngineProcessName} PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_${config_upper} "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}") +endforeach() + +if(QT_FEATURE_debug_and_release) + set_target_properties(${qtWebEngineProcessName} PROPERTIES + OUTPUT_NAME_DEBUG ${qtWebEngineProcessName}${CMAKE_DEBUG_POSTFIX}) +endif() if(isFramework) set_target_properties(${qtWebEngineProcessName} PROPERTIES MACOSX_BUNDLE TRUE) @@ -48,8 +59,14 @@ if(isFramework) ) else() install(TARGETS ${qtWebEngineProcessName} + CONFIGURATIONS ${configs} RUNTIME DESTINATION "${INSTALL_LIBEXECDIR}" - CONFIGURATIONS ${config} + ) +endif() + +if(MSVC) + install(FILES "$<TARGET_PDB_FILE:${qtWebEngineProcessName}>" OPTIONAL + DESTINATION "${INSTALL_LIBEXECDIR}" ) endif() |