summaryrefslogtreecommitdiffstats
path: root/cmake/QtBaseConfigureTests.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Port most of the configure summary supportAlexandru Croitor2020-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Teaches configurejson2cmake about summaries / reports, so things like enabled features, configure sections, notes, etc. Add relevant CMake API for adding summary sections and entries, as well as configure reports. The commands record the passed data, and the data is later evaluated when the summary needs to be printed. This is needed, to ensure that all features are evaluated by the time the summary is printed. Some report and summary entries are not generated if they mention a feature that is explicitly exclduded by configurejson2cmake's feature mapping dictionary. This is to prevent CMake from failing at configure time when trying to evaluate an unknown feature. We should re-enable these in the future. A few custom report types are skipped by configurejson2cmake (like values of qmake CONFIG or buildParts). These will have to be addressed a case-by-case basis if still needed. Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add initial support for CMake "Ninja Multi-Config" generatorAlexandru Croitor2020-01-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows doing debug_and_release builds with Ninja on all platforms. The "Ninja Multi-Config generator" is available starting with CMake 3.17. Desired configurations can be set via CMAKE_CONFIGURATION_TYPES. Possible values: "Release, Debug, RelWithDebInfo, MinRelSize". For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug". The first configuration is the 'default' configuration which is built when calling ninja with no arguments. To build all targets of a certain configuration use "ninja all:Release" or "ninja all:Debug". To build all targets in all configurations use "ninja all:all". Note that the first configuration influences which configuration of tools will be used when building the libraries for all configurations. In simple terms, when configured with -DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc is used by AUTOMOC. When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release" the debug version of moc is used by AUTOMOC. Framework builds and Ninja Multi-Config don't currently work together due to multiple bugs in CMake, which ends up generating an invalid ninja file with duplicate rules. There are also issues with placement of the debug artifacts. This will be handled in a follow up patch after CMake is fixed. Task-number: QTBUG-76899 Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add initial support for cross-building to iOSAlexandru Croitor2019-12-031-13/+30
| | | | | | | | | | | | | | | | | | | | | | Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Rename / prefix all our private API functions with qt_Alexandru Croitor2019-11-141-10/+10
| | | | | | | | | | | Rename internal APIs like extend_target to qt_extend_target. Prefix apis with qt_ where required. Keep old names for compatibility until all their usages are removed. Change-Id: I9a13515a01857257a4c5be3a89253749d46a4f41 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix architecture config tests values to be written only onceAlexandru Croitor2019-11-081-5/+6
| | | | | | | | | | | | | | | | Every time the qtbase project was reconfigured, the list of config tests results was appended to a cache variable which was never reset, resulting in multiple copies of the same values being written to QtBuildInternalsExtra.cmake. Make sure to clean the cache variable before appending to it. Also change the variable to be all upper-case, to be consistent with other cache variables. Change-Id: Ic12046730a080595e19377981a726bc330641dc1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Android x86 buildsLeander Beernaert2019-11-081-0/+9
| | | | | | | | | | | | Replace condition x86 to i386 to match other platforms. Regenerate src/gui/CMakeLists.txt Disable SSE4 on android x86 to match qmake. Change-Id: Ic0d330206f2d70a79d72553aa3ff0f91ff58119c Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix architecture detection with WASM buildsSimon Hausmann2019-08-281-0/+11
| | | | | | | | | This is a simple mis-understanding between try_compile assuming interest in the launching part of the thing we try to compile and our architecture test being interested in the binary. Change-Id: Ie972b662b6f34699f566649bb2c1e29da35b58c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Export architecture config test variablesLeander Beernaert2019-08-141-1/+5
| | | | | | | | | Export the architecture configuration variables from QtBase. There are other modules that require access to this information in order to enable certain features (e.g: qml_jit in QtDeclarative). Change-Id: If2c7f29ccb1c0b0a0db3d78ad133a2a6be12b5ad Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix error in run_config_test_architectureLeander Beernaert2019-06-261-1/+1
| | | | | | | | | The run_config_test_architecture() function in QtBaseConfig was not working correctly as we were not updating the length of the line properly. Change-Id: I29c5b45f1fa36d16cb2ef00950feb80987f6b176 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix architecture detection when targeting plain armSimon Hausmann2019-05-291-2/+3
| | | | | | | | | We record extra CPU features such as neon, etc. in the sub-architecture field, which may very well be empty. Allow for that and avoid cmake warnings about indexed string access beyond the string boundaries. Change-Id: I63e61c6427d156180039b8ac6f5b0f5f55c36ee8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Turn off linker version script support on macOSAlexandru Croitor2019-04-091-0/+7
| | | | | | | | The test erroneously succeeds on macOS with an XCode generator. Explicitly set the test result to be turned off. Change-Id: Id6fcb96f420f611517e81cc3697f1c88b508bd7c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix sub-architecture (instruction sets / SIMD) handlingAlexandru Croitor2019-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In qmake there are at least 2 things to know regarding sub-architectures and instruction sets. Which instruction sets does the compiler know to compile for, represented by the various config.tests and features in qtbase/configure.json. And which instructions sets are enabled by the compiler by default, represented by the configure.json "architecture" test and accessed via QT_CPU_FEATURES.$$arch qmake argument. Before this patch there was some mishandling of the above concepts in CMake code. The former can now be checked in CMake with via TEST_subarch_foo and QT_FEATURE_foo (where foo is sse2, etc). The latter can now be checked by TEST_arch_${TEST_architecture_arch}_subarch_foo (where foo is sse2, etc and the main arch is dynamyicall evaluated). The configurejson2cmake script was adjusted to take care of the above changes, and the cmake files were regenerated as well. Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Improve handling of the different kinds of iconvTobias Hunger2018-11-061-1/+3
| | | | | | | | | Improve conditions/enable/disable conditions for iconv related features. These are detected a bit different from what qmake does, so adapt to that. Change-Id: I7b3e4baf05dc324507f370d7f651a62f29e42a98 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+139
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>