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 /utils | |
parent | 77e4dd81f5abedda802b8b6e895849995907b484 (diff) | |
download | rockbox-430999e399a5321e97e28ebc6eccc6bc46c618fe.tar.gz rockbox-430999e399a5321e97e28ebc6eccc6bc46c618fe.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
Diffstat (limited to 'utils')
-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") | |||
104 | endif() | 104 | endif() |
105 | set(DMGBUILD ${CMAKE_BINARY_DIR}/venv/bin/python3 -m dmgbuild) | 105 | set(DMGBUILD ${CMAKE_BINARY_DIR}/venv/bin/python3 -m dmgbuild) |
106 | set(DMGBUILD_STAMP ${CMAKE_BINARY_DIR}/dmgbuild.stamp) | 106 | set(DMGBUILD_STAMP ${CMAKE_BINARY_DIR}/dmgbuild.stamp) |
107 | find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${qtbindir}") | 107 | find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QTBINDIR}") |
108 | 108 | ||
109 | # need extra rules so we can use generator expressions | 109 | # need extra rules so we can use generator expressions |
110 | # (using get_target_property() doesn't know neede values during generation) | 110 | # (using get_target_property() doesn't know neede values during generation) |
@@ -160,7 +160,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | |||
160 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") | 160 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") |
161 | message(WARNING "Deploying a Debug build.") | 161 | message(WARNING "Deploying a Debug build.") |
162 | endif() | 162 | endif() |
163 | find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${qtbindir}") | 163 | find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QTBINDIR}") |
164 | set(deploydir ${CMAKE_BINARY_DIR}/deploy-${deploy_TARGET}) | 164 | set(deploydir ${CMAKE_BINARY_DIR}/deploy-${deploy_TARGET}) |
165 | if(WINDEPLOYQT_EXECUTABLE) | 165 | if(WINDEPLOYQT_EXECUTABLE) |
166 | add_custom_command( | 166 | add_custom_command( |
@@ -169,7 +169,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | |||
169 | COMMAND ${CMAKE_COMMAND} -E make_directory ${deploydir} | 169 | COMMAND ${CMAKE_COMMAND} -E make_directory ${deploydir} |
170 | COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${deploy_TARGET}> ${deploydir} | 170 | COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${deploy_TARGET}> ${deploydir} |
171 | COMMAND ${WINDEPLOYQT_EXECUTABLE} | 171 | COMMAND ${WINDEPLOYQT_EXECUTABLE} |
172 | $<IF:$<CONFIG:Debug>,--debug,--release> # on MinGW, release is mistaken as debug. | 172 | # on MinGW, release is mistaken as debug for Qt less than 5.14. |
173 | # For later versions the opposite is true: adding --debug or | ||
174 | # --release will fail with "platform plugin not found." | ||
175 | $<IF:$<VERSION_LESS:${Qt${QT_VERSION_MAJOR}Core_VERSION},5.14.0>,$<IF:$<CONFIG:Debug>,--debug,--release>,> | ||
173 | ${deploydir}/$<TARGET_FILE_NAME:${deploy_TARGET}> | 176 | ${deploydir}/$<TARGET_FILE_NAME:${deploy_TARGET}> |
174 | DEPENDS ${deploy_TARGET} | 177 | DEPENDS ${deploy_TARGET} |
175 | ) | 178 | ) |