Build Qt 5.15 from source for iOS
-
I need to build Qt for iOS from source. I have a build script in a bash shell that looks basically as follows for a developer build:
declare -r warnings_off=( -Wno-unused-variable -Wno-deprecated-declarations -Wno-null-pointer-subtraction -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-non-c-typedef-for-linkage -Wno-unused-value ) "$SOURCE_DIRECTORY/configure" -debug-and-release QMAKE_CXXFLAGS_WARN_ON="-Wall ${warnings_off[*]}" QMAKE_IOS_DEPLOYMENT_TARGET=16.0 -appstore-compliant -force-debug-info -developer-build -opensource -confirm-license -xplatform macx-ios-clang -no-openssl -nomake examples -nomake tests -no-compile-examples -no-widgets -no-icu -no-feature-bearermanagement -securetransport -sdk iphoneos
It didn't used to be this complicated. Originally, when I was using qt 5.15.5 it didn't have any specification for QMAKE_CXXFLAGS_WARN_ON or QMAKE_IOS_DEPLOYMENT_TARGET, but as I tried to build 5.15.9, I started to get warnings all over the place. Part of that is that the current build tools in Xcode are getting less and less tolerant of minor language misuse cases. These come up as warnings and warnings, and in developer mode, warnings-as-errors is turned on. So I've been growing a list of warnings to ignore, but it's getting big. Then there are the "snippets". I don't know what a snippet is, but I know three things about them. I didn't need or use them in previous versions, I don't want them, and they are part of the code that is failing at build time. They do not seem to honor the QMAKE_CXXFLAGS_WARN_ON property, because the warnings the warning suppression don't show up there on the make spew. Is there a configuration option to make them go away? Is there a make target that doesn't build them?
The final problem is in qtbase/src/corelib/global/qglobal.cpp. It uses some IOKit code to generate a device-unique identifier, but the API is only available on iOS with the most recent version, so I have to specify my specify my deployment target to version 16. It uses the same code in the snippets, but that's for my development platform, so that's a MacOS deployment target issue. It didn't used to be this broken or this complicated. Looking at the code and build scripts, I don't see how this could have worked for anyone. Don't these things have to build on some CI machine? Is it just that my build tools have migrated past the versions that Qt CI machines use? It has always been a bit complicated to build Qt, but it seems to have gotten to the point where its can't be done at all.
Am I doing something obviously wrong? Is there a way to filter out the snippets? What's the deal with the deployment target? I don't think the intention is for the latest Qt to require the absolute latest OS. Any pointers would be helpful.