diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-13 16:15:32 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2022-03-13 16:20:10 +0100 |
commit | 430999e399a5321e97e28ebc6eccc6bc46c618fe (patch) | |
tree | 6ef5accb05f7cb1050940e8d55c195054a347fb5 | |
parent | 77e4dd81f5abedda802b8b6e895849995907b484 (diff) | |
download | rockbox-430999e399.tar.gz rockbox-430999e399.zip |
utils: Work around windeployqt bug.
For Qt versions less than 5.14 MinGW windeployqt requires passing
--release or --debug to pick the correct libs to deploy. For newer
version this must not be passed, or otherwise windeployqt errors out.
Use a conditional expression to only add the parameter for older Qt
versions.
Change-Id: I7afe2b77e9829e989adaeeb7c7499d5955926da2
-rw-r--r-- | utils/cmake/deploy.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/cmake/deploy.cmake b/utils/cmake/deploy.cmake index f1430f0dee..252aba0636 100644 --- a/utils/cmake/deploy.cmake +++ b/utils/cmake/deploy.cmake @@ -104,7 +104,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") endif() set(DMGBUILD ${CMAKE_BINARY_DIR}/venv/bin/python3 -m dmgbuild) set(DMGBUILD_STAMP ${CMAKE_BINARY_DIR}/dmgbuild.stamp) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${qtbindir}") + find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QTBINDIR}") # need extra rules so we can use generator expressions # (using get_target_property() doesn't know neede values during generation) @@ -160,7 +160,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") message(WARNING "Deploying a Debug build.") endif() - find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${qtbindir}") + find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QTBINDIR}") set(deploydir ${CMAKE_BINARY_DIR}/deploy-${deploy_TARGET}) if(WINDEPLOYQT_EXECUTABLE) add_custom_command( @@ -169,7 +169,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") COMMAND ${CMAKE_COMMAND} -E make_directory ${deploydir} COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${deploy_TARGET}> ${deploydir} COMMAND ${WINDEPLOYQT_EXECUTABLE} - $<IF:$<CONFIG:Debug>,--debug,--release> # on MinGW, release is mistaken as debug. + # on MinGW, release is mistaken as debug for Qt less than 5.14. + # For later versions the opposite is true: adding --debug or + # --release will fail with "platform plugin not found." + $<IF:$<VERSION_LESS:${Qt${QT_VERSION_MAJOR}Core_VERSION},5.14.0>,$<IF:$<CONFIG:Debug>,--debug,--release>,> ${deploydir}/$<TARGET_FILE_NAME:${deploy_TARGET}> DEPENDS ${deploy_TARGET} ) |