summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* Add a few more 3rd party libraries to helper.pyAlexandru Croitor2019-05-211-0/+3
| | | | | | | | Handle a few more libraries that are used in qtimageformats repi. Change-Id: Ia3b9a845bc6cb8ce98a477b9355011bbadc32c1a Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix the fix to correctly handle comments in multi-line assignmentsAlexandru Croitor2019-05-203-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous fix where the Grammar comment style was changed to remove the newlines was incorrect, because if you have foo=1#comment bar=2 after the Grammar comment ignoring, it would transform into foo=1bar=2 which will clearly fail to parse, so the new line has to stay. But we would still have the following case which would fail: foo=a \ # comment b Apparently qmake things that's the equivalent of foo=a b but the grammar parses it as foo=a \ \n (newline) b Thus the parsing fails because there's a newline and then some weird 'b' token which the grammar does not expect. The best fix I found is to preprocess the source, to remove completely commented out lines. So: foo=a \ # comment b gets transformed into foo=a \ b Change-Id: I2487a0dbf94a6ad4d917d0a0ce05247341e9b7da Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Improve configure2cmake to find_package only in certain conditionsAlexandru Croitor2019-05-202-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make much sense to look for X11 related packages on macOS and Windows by default. Usually they would not be there, and as a result the configuration step would show a long list of scary not found packages, and also eat precious configure time. Change the conversion script to allow putting conditions around generated find_package calls. These conditions can be manually set in the conversion script library mapping, using the emit_if argument, which we do for the X11 and Wayland related packages. They are also computed by checking which features use a given library, and if the feature is protected by a simple emitIf condition like config.linux, the relevant library find_package call will be protected by the same condition. If a developer still wishes to look for all packages, they can define the CACHE variable QT_FIND_ALL_PACKAGES_ALWAYS to ON. The relevant configure.cmake files are regenerated in this patch. Change-Id: I6f918a94f50257ec41d6216305dae9774933389a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Handle the new cmdline config feature in pro2cmakeAlexandru Croitor2019-05-201-1/+2
| | | | | | | | cmdline implies console, so use that also to determine if a binary should get a GUI flag. Change-Id: I084e0a45785df96a7dc2c101af5305fbb39efbc3 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Workaround fix in pro2cmake Operation __init__ methodAlexandru Croitor2019-05-201-2/+5
| | | | | | | | | | There are still call sites that call Operation.__init__ with a string instead of a list. Restore the handling of such a case. Amends 5fe8a38af34d1530f14c3b695dee5a33e4a85554 Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Don't exclude QtCore from dependencies when generating modulesAlexandru Croitor2019-05-201-2/+2
| | | | | | | | | | | | | and plugins. src/network/network.pro for instance depends on core-private, but because we ignore adding QtCore as a public dependency, the exported Config file for Network doesn't depend on QtCore anymore, so if a user only links against Network, they won't automatically link against Core. Change-Id: I4a60ffae7e071927360b8ccf6b1b7479ab391060 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix parsing qmake assignments that have comments in betweenAlexandru Croitor2019-05-173-1/+14
| | | | | | | | | | | | | | | | For some reason the python comment regex that we used does not ignore the line break at the end of a comment line. This caused issues when parsing multi line assignments with comments in between. Use our own regex for comments to circumvent the issue. It was found while trying to port the qtimageformats repo. Added a pytest as well. Change-Id: Ie4bbdac2d1e1c133bc787a995224d0bbd8238204 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Fix test_scope_handlingTobias Hunger2019-05-171-31/+31
| | | | | | | Adapt to updated APIs in pro2cmake.py Change-Id: I39898b675e27d6295ef6cfa049c82b245d71188a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix test_operationsTobias Hunger2019-05-173-18/+22
| | | | | | | Fix test_operations and do some small mypy cleanups along the way Change-Id: I6586b5d3491e5dcf44252c098516f0922fa60420 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Wrap DBus1 find_package call to fix xproto not being picked upTobias Hunger2019-05-101-1/+1
| | | | | | | | | | | | | | DBus1 (1.12) configuration file breaks PKG_CONFIG environment variables and will thus prevent other libraries to be picked up by pkgconfig. Main sympthom is that xproto is not getting picked up anymore, which results in hundreds of lines of warnings about this being printed. Work around that by wrapping the call to find_package(DBus1) and restoring the environment. Change-Id: Ia69f10b014dddc32045b40972500a843e5d29b38 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Add target_link_libraries to examplesTobias Hunger2019-05-091-0/+4
| | | | | Change-Id: Ic7054f0c88e228496b7f4855bffa5620ed717f9b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Generate find_package information into examplesTobias Hunger2019-05-092-10/+46
| | | | | Change-Id: I6dab13ebea4386019f14be5f29a143d194268aac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Keep "special case" modifications when regenerating project filesAlexandru Croitor2019-05-092-4/+394
| | | | | | | | | | | | | | | | | | | | | | | | | The pro2cmake.py file is now smarter, and can reapply "special case" modifications after regenerating a CMakeLists.txt file. This substantially lowers the maintenance burden when regenerating many files at once. See the special_case_helper.py file for details on how it works. Make sure to commit the generated .prev_CMakeLists.txt file alongside your CMakeLists.txt changes. To disable the preservation behavior, you can pass -s or --skip-special-case-preservation to the script. To keep around temporary files that are created during this process, you can pass -k or --keep-temporary-files. To get more debug output, pass --debug-special-case-preservation. Fixes: QTBUG-75619 Change-Id: I6d8ba52ac5feb5020f31d47841203104c2a061d8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: scripts: Extract code to write find_package linesTobias Hunger2019-05-092-25/+42
| | | | | | | | Extract code to write find_package lines from configurejson2cmake.py and move this over into helper.py. Change-Id: Iefd313b2a56cb78a99a7f3151c3f6c6284482f79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Separate library extraction logic from writing out dataTobias Hunger2019-05-091-65/+64
| | | | | | | | | | | | | | Separate the logic to find all used libraries from the code that writes out the link_library information into the CMakeLists(.gen)?.txt files. This patch will remove some "PUBLIC_LIBRARIES Qt::Core" from generated files. This is due to us handling some Qt libraries in special ways in some of our add_qt_* helpers. These special libraries were added to the LIBRARIES section, but actually they should be added to the PUBLIC_LIBRARIES section instead. Do so now, so that the newly generated files do not break things again. Change-Id: I588781087a8aecc4d879e949735671d8085f0698 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Extract writing lists into cmake filesTobias Hunger2019-05-091-61/+47
| | | | | | | | | | Extract the actual functionality to write a list of "things" below headers and/or cmake parameter and followed by a footer. Reuse this functionality everywhere we write a list of things. Change-Id: Ia7647be465b4788a2b1e6a5dbede1ca868f24ae2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: scripts: Fix mypy issuesTobias Hunger2019-05-092-14/+16
| | | | | Change-Id: I706740be79eccd6bf08213fdaf747dde08cd053a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Add basic support for examplesTobias Hunger2019-05-091-39/+118
| | | | | | | | | | | | | | Examples need to be built stand-alone and as part of Qt, so they need a special CMakeLists.txt file that supports both use-cases. Add an --is-example switch to pro2cmake to make it generate these special CMakeLists.txt files. This is basic support only and is currently still missing the necessary find_package calls. Change-Id: Ie770287350fb8a41e872cb0ea607923caa33073d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Do not fail when run from .pro-file directoryTobias Hunger2019-05-081-1/+2
| | | | | Change-Id: I285b05986e3a58efc060ca0b5732f6e3f5121476 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix freetype target not being found when using vcpkgAlexandru Croitor2019-05-081-1/+1
| | | | | | | | | | vcpkg and upstream CMake find module define different target names for the same package. To circumvent this, create our own Wrap find module, and link against it. Inside the find module, try both target names. Change-Id: Iba488bce0fb410ddb83f6414244f86ad367de72b Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Force pro2cmake.py to always change the dir to the converted pro fileAlexandru Croitor2019-05-071-2/+9
| | | | | | | | Otherwise if you call the script from a different directory, path handling becomes broken and certain files are not found. Change-Id: Ia2f60abbd312a771330b3d5e928e1ccd0b4a845b Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: scripts: Make xcb_qpa_lib known as a Qt moduleTobias Hunger2019-05-071-0/+1
| | | | | Change-Id: I65f48d86c4ec946b38004b945078f29625e32d93 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: scripts: Treat libraries mapped to None as knownTobias Hunger2019-05-071-1/+1
| | | | | | | | | This detects doubleconversion as a 3rd party library. This fixes defaulting QT_FEATURE_system_doubleconversion to 'ON'. Change-Id: I9d18dbbb6f7a99f6a5c674bed3013b96f19bf6e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Scripts: Fix double entries in 3rd party library mappingTobias Hunger2019-05-061-2/+0
| | | | | Change-Id: I35f29876874d6083d19382800d194e417d57bca1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Fix library mappingTobias Hunger2019-05-063-29/+45
| | | | | | | | | | | | | Fix library substitution again which broke when I merged all the library related pieces of information. Keep Qt and 3rdparty libraries separate so that dbus does not get mapped into Qt::DBus (or the other way around). Make names in helper.py more consistent while at it. Change-Id: I5e5bf02bdabf8bafe991c5701deca76bde4df2c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make zlib a required package for QtCoreAlexandru Croitor2019-05-031-1/+1
| | | | | Change-Id: Ifbb969fafe05e355d6874d8bebe2e8f1e80510ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Improve mapping of librariesTobias Hunger2019-05-033-282/+272
| | | | | | | | | | | | | Merge all data related to mapping libraries into one data structure in helper.py. Use that data for everything related to library mapping. This change enables way more features now like e.g. adding find_package calls into generated files. Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: configurejson2cmake: Do not generate useless OPTIONALsTobias Hunger2019-05-031-3/+2
| | | | | | | | | | Do not set properties of packages to type OPTIONAL. That is the default anyway. Update generator script and generated files. Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Fix xcb_glx buildAlbert Astals Cid2019-05-031-0/+1
| | | | | | | Use the actual cmake library target name Change-Id: Icda1d232e3b920bf33ebceb00f39682050f7dedd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Write find_dependency() calls in Qt Module config filesAlexandru Croitor2019-05-022-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Make freetype a required packageAlexandru Croitor2019-05-011-1/+1
| | | | | | | | | With qmake if we don't find a system package, we use the bundled one. With CMake we don't provide a bundle freetype, hence it's required to find a system one (or custom provided one). Change-Id: I00a5e2ac55459957dae0729f89bafa792a102152 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-1612-117/+187
|\ | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Replace Q_DECL_NOTHROW with noexcept the remaining placesAllan Sandfeld Jensen2019-04-091-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | The first replacement had missed objective-C++ code some places ourside the src dir. In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still need to turn it off when compiled in C mode, but can get rid of the old NOTHROW moniker. Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-03-261-8/+6
| |\ | | | | | | | | | Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-8/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| | | * Remove broken code from unicode generatorEskil Abrahamsen Blomfeldt2019-03-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current state produces uncompilable code. Change-Id: I9a68b61866a4a416335ed4d7204c58122803fb1c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | * Wasm: Add workaround for Emscripten compiler againEskil Abrahamsen Blomfeldt2019-03-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work around was added directly to the generated files at some point, and never to the generator it seems. So to avoid removing the workaround again when we regenerate the next time, we need to add it. Task-number: QTBUG-74511 Change-Id: Ided1bd949234ba82df61c55891646823e7f72e80 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | | Clean up and document the generator for qurltld_p.hEdward Welbourne2019-03-191-67/+96
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This scans the public suffix list and emits suitable content for the header. Made some modest efficiency gains while hopefully making the code easier to understand. Check for success when opening files. Change-Id: If6b25c5c85f86209b33d9188743e820690e7dc05 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | Adjust chunk-size in TLD-suffix list to placate MSVC 2015Edward Welbourne2019-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2015 has a size limit on strings; sizeof (including the terminating '\0') must not exceed 0xffff. The generator for the suffix-list data worked round this by breaking its data into chunks of at most 0xffff bytes; however, it was limiting on the strlen, not the sizeof, so was off by one. It checked for this before adding each suffix, so has (until now) always happened to break early enough; but the latest update gave an exactly 0xffff chunk, whose terminating '\0' took it over MSVC's limit. So adjust the cutoff to effectively include the terminating '\0'. Task-number: QTBUG-72623 Change-Id: I76ea40060d9fc13c0f7002c5ba22e71b8d0af787 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
| * | Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | | | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-192-4/+2
| |\| | | | | | | | | | Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
| | * Add cmdline feature to qmakeJoerg Bornemann2019-02-182-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][qmake] A new feature "cmdline" was added that implies "CONFIG += console" and "CONFIG -= app_bundle". Task-number: QTBUG-27079 Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
| * | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-132-7/+35
| |\| | | | | | | | | | Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
| | * Clean up and update Unicode character data 3rd-party infrastructureEdward Welbourne2018-11-112-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document how to do an update, fix the bit-rot that had crept into main.cpp since last it was compiled, correct the qt_attribution.json to use the actual version number of UCD (its Revision number) instead of the (admittedly correlated) Unicode release number. Updated to Release 22 (which came with Unicode 11.0.0) in the process; but this doesn't change our actual qunicodetables.cpp (so is incidental). Task-number: QTBUG-71281 Change-Id: Ieb7a6e1a4d49f639993f76ff82c8f12a572db3c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Make util/lexgen/ mention itself in its auto-gen lineEdward Welbourne2018-11-014-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the process, update the README's e-mail address for Simon and mention all recognized command-line options in the usage message. The generated CSS scanner was also out of sync with our source, so update it. Also fixed handling of FileHeader to cope with running from a shadow build by handling paths relative to __FILE__; and revised the CSS3 config to use the same copyright header as was already in use by the existing generated file. Change-Id: I918ff84dbdc95d0478fd6aa4ea74e9a221d1a476 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | CMake: Map xkbcommon_supportTobias Hunger2019-04-121-0/+1
| | | | | | | | | | | | | | | | | | | | | Qt 5.12 comes with xkbcommon_support now. Map that accordingly. Change-Id: Id10708349d377f6bdfed654428ebcef0b533bd69 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | | CMake: pro2cmake.py: Fix handling of libraries in QTTobias Hunger2019-04-121-9/+7
| | | | | | | | | | | | | | | Change-Id: I5737a285ca0575a454e60fad231435d96b2f1be7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: pro2cmake.py: Inherrit VPATH from parent scopesTobias Hunger2019-04-121-4/+8
| | | | | | | | | | | | | | | Change-Id: I95b62fdf3a4cba674bef5a58f0d414464daa3b0c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: pro2cmake.py: Handle setting a key with $$key in the valueTobias Hunger2019-04-121-10/+18
| | | | | | | | | | | | | | | Change-Id: I86552ed2a30f07f8c6060b2bad04fd5489b1d482 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | CMake: Configurejson2cmake: Always enable system-pcre2 and handle dlopenTobias Hunger2019-04-121-2/+4
| | | | | | | | | | | | | | | | | | | | | Handle dlopen properly. Code is ifdef-ed on it, so we need it:-/ Change-Id: I7f35d24b97530796a4cdcdc1acbe139757170215 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>