This adds the build system feature that allows Qt Creator's libraries
and plugins to be compiled statically.
Fixes some symbol clashes when all plugins are linked into the same
executable.
Support for actually loading static plugins will be added in a separate
commit.
The feature is controlled by QTC_STATIC_BUILD which by default is OFF.
Change-Id: I1fab7953c43e42dc75619e35660029ee067106df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The ELF default is historical legacy. We should always require all
libraries and all plugins to link to their dependencies and not
accidentally forget something (like implementing a virtual function).
Change-Id: I5e00996d7f4b4a10bc98fffd1629f8bfcf0d1c8f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The functionality comes from Qt6 and will be enabled only for Qt6 builds.
/w3 level for MSVC, -Wall -Wextra for the rest of compilers.
Change-Id: Ib62a27e50ce37a6a860ba2bfa1bdb80a7ae60ace
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Add another option to mark a test as manual and use this for some
existing.
Manual tests will not be added as a ctest, but they can still get
executed explicitly.
Beside this allow to use a condition when using add_qtc_test().
Change-Id: I03d5397db36c0a2c9ee506a4214ed68fae6ad6e7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Prepend our own relative RPATHs to CMAKE_INSTALL_RPATH (or
CMAKE_BUILD_RPATH respectively) instead of overriding them completely.
That allows adding an RPATH to e.g. a self-compiled and separately
installed Qt to the installed Qt Creator.
Fixes: QTCREATORBUG-27008
Change-Id: I8cd9167fdf5ba9838850fcfab8135da9b79e6695
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
CMake 3.16 is available on the major Linux distributions nowadays,
so we can get rid of some workarounds.
Change-Id: I32500375748f33c3e40fbd7a08824d823f817a8f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.
Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Qt 5.15.2 includes API that makes transitioning to Qt 6 easier.
We currently have workarounds for Qt 5.14 in place that we can
remove when requiring 5.15.2, and we also can stop adding workarounds
for new code.
Change-Id: I920fdccc41d755a6ad39cb5161cd916999fee755
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Without SKIP_DEPENDENCY the source files would be treated as cmake
list files, which meant that for every source change cmake would
have been rerun.
Change-Id: Icc087fa951fa7e7aee25504367b6146e66bf9dcb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
When running cmake after a build was done on Windows with MSVC will
get more files to build:
[1/15 9.0/sec] Running utility command for copy_python_dll
[2/15 3.6/sec] Automatic MOC and UIC for target ProjectExplorer
[3/15 2.2/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\sessiondialog.cpp.obj
[4/15 2.9/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\codestylesettingspropertiespage.cpp.obj
[5/15 3.6/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\editorsettingspropertiespage.cpp.obj
[6/15 4.1/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\projectexplorersettingspage.cpp.obj
[7/15 4.6/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\sessionmodel.cpp.obj
[8/15 5.1/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\customparserconfigdialog.cpp.obj
[9/15 5.2/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\projectwizardpage.cpp.obj
[10/15 3.4/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\ProjectExplorer_autogen\mocs_compilation.cpp.obj
[11/15 1.6/sec] Building CXX object
src\plugins\projectexplorer\CMakeFiles\ProjectExplorer.dir\projectexplorer.cpp.obj
[12/15 1.6/sec] Linking CXX shared library
lib\qtcreator\plugins\ProjectExplorer.dll
When adding "-d explain" to the build parameters ninja would print:
ninja explain: restat of output
src/plugins/projectexplorer/ProjectExplorer_autogen/timestamp older than
most recent input
src/plugins/projectexplorer/.rcc/generated_testdata.qrc.in
(6611078583964975 vs 6611078835307007)
ninja explain:
C:/Projects/QtCreator/build-repo-Desktop_Qt_5_15_2_MSVC2019_64bit-Release/src/plugins/projectexplorer/ProjectExplorer_autogen/mocs_compilation.cpp
is dirty
Change-Id: Iaa00478bb6d81f7235d25ad541fbf86c7ca593f6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This was needed in the early days of the CMake port when the list of
source files would change due to being added to the qmake project
files.
Change-Id: I7afd219b24ab7a0d87fce26ba35dac75cf8caa5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Usually that is done by Qt, but not if reduce_relocations is off.
Fixes: QTCREATORBUG-26435
Change-Id: Idd337d59555fd6e732215b9c753820672f63c91f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This was done to have qmake parity when we compared the qmake and cmake
release builds.
Since we are past that now, and the cmake build is the one used to do
releases, we can drop the number from the dlls.
Change-Id: I60d1b368daf4258884c239204c2e3c18f244e930
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
They should have the same base name as the DLL/.lib, but were missing
the version number.
Fixes: QTCREATORBUG-25968
Change-Id: I30e39a62b94264bd5a4852f0b1100044fa47d811
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
If a library changes its implementation only, don't relink all
libraries that depend on it. This is usually not necessary since the
API stayed the same.
Fixes: QTCREATORBUG-25962
Change-Id: I0221b09afd92463c3dad40bd0107ba0d5668ac79
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This will allow for the Qt Creator's CMake build only qtcreator
target to be selected as runnable.
Similar to qmake's qtc_runnable or Qbs's qtcRunnable features.
Fixes: QTCREATORBUG-25908
Change-Id: I6416873d0ad9cfec4960d98fc4b289ec98cc58b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Even in the debug build, as done for the qmake build system. This is for
performance optimization of this critical part for C++ parsing even in
debug / developer builds.
Change-Id: I9552ba9fc44e213f2df1d2d2a64a126af3603fd1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This allows building one test: -DBUILD_TESTS=tst_my_test, this will set
BUILD_TESTS_BY_DEFAULT to OFF (default value is ON) and set
BUILD_TEST_TST_MY_TEST to ON.
Change-Id: I7800f3d238121725bb9fa4146f76ddcd2b10bde9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This reverts commit 99396421de.
The patch does not solve the use case (building Qt Creator without
tests and then only building individual tests), and has lots of
side effects like tests landing in the application bundle on macOS
and in bin on Windows, and tests being installed.
Change-Id: I593627b55577e13a3d2cf1758deac99efa521954
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Make the files from qtc_copy_to_builddir part of the project tree, so
they get included in searches etc.
Change-Id: I191f88c8520b9e4a16fd6a5acfeda9cf880cea89
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
extend_qtc_test should gracefully do nothing if the test was declared,
but disabled for any reason.
add_qtc_test failed to add the test to the list of declared tests, if
dependencies were missing, so extend_qtc_test was complaining that the
test didn't exist in that case.
add_qtc_test must always add the test to the list of declared tests, and
extend_qtc_test must only fail if the test was never declared, but do
nothing if the test target does not exist (because the test was disabled
for some reason).
Change-Id: I414a169e3e23c3c0e11c11e2ee86effa706b545c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Otherwise qtc_add_resources fails when turning off corresponding
BUILD_.... flags, or needs to be wrapped with "if(TARGET ...)" everywhere.
Change-Id: I34e230569ab9619b1c107404bf2fdf8e8e86bd7e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
- there is no reason for putting them elsewhere
- since CMake file-api only reports the .lib location for linked
libraries, Qt Creator has difficulties with adding the correct
PATH for running e.g. manual tests, when the .lib files are at
an arbitrary location
Fixes: QTCREATORBUG-25684
Change-Id: I24b26a79c70fd5384f534f8f0b66b51fca1ecc56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
sccache does not support the "/Zi /FS" option for debug information
with MSVC. Optionally replace "/Zi" by "/Z7", which leaves debug
information in the object files and only collects it at link time.
See also qtbase 2354274f39934b94383923834479901106489def.
Change-Id: Id94c2116f3c4192556dbdf8fe82b12ce0a204273
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
On Linux (and Windows) we should not create toplevel files (README.md
etc) or directories (doc/, scripts/ etc).
On macOS, move the whole Devel package contents into the app bundle,
because that is installed toplevel in the Qt installers, and we
shouldn't even create include/, lib/ or any other directory at the
toplevel at all.
Since the prefix path must now point to the Resources folder inside the
app bundle, adapt build_plugin.py to also accept --qtc-path pointing to
the app bundle (Qt Creator.app) itself, and also to the app bundles
parent directory. Adapt the Qt Creator plugin project template
similarly.
Task-number: QTCREATORBUG-25414
Fixes: QTCREATORBUG-25415
Change-Id: Ic756237fb920b54b1ec95d076649ad947b39a7e8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Add the pch files that qmake uses.
On Windows, the .lib files must have the major version too,
like the DLLs.
Change-Id: I437bbeac0323c5b9bc174ddea8c0d9be6497b4e6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Tracing library does not build with Qt 6. Disable that automatically
and also the plugins that depend on it. Add some feature info for
the Tracing library, though we usually do not add feature information
for libraries in general.
Change-Id: I51b6993e30ec69d63a031c7bf404ea3887e14d84
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This adds at least partial, transitional support for building
3rdparty plugins with qmake against Qt Creator built with CMake.
This might still miss some other .pri files that follow
their own naming conventions.
Fixes: QTCREATORBUG-24055
Fixes: QTCREATORBUG-25334
Change-Id: I83cc547da938976c2ec12a21a17f286b937147f7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
In the CMake build in general, but still use it for
RelWithDebInfo builds with the build*.py scripts.
Fixes: QTCREATORBUG-25151
Change-Id: I8414f953278ebb395f73414c12af0ed7bd4fcdbe
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Test dependencies are not "real" code dependencies, they just
declare that for testing the plugin the other plugin has to
be loaded, even though it is _not_ a code dependency.
Add PLUGIN_TEST_DEPENDS to add_qtc_plugin. We cannot assume
that the target exists at that point, so adapt the usual pattern.
Fixes: QTCREATORBUG-25024
Change-Id: I4165ff8df762309e0be0bfe9e8bedef796a3bf17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>