Commit Graph

42 Commits

Author SHA1 Message Date
Marcus Tillmanns
66eca4cb4b CMake: Fix WITH_SANITIZE
Adding qtc_enable_sanitize to add_qtc_executable to also instrument applications

Changing qtc_enable_sanitize to use target_compile_options instead of trying
to modify CMAKE_CXX_FLAGS_DEBUG and hoping that nobody else overwrites it,
which previously erased the added flags.

Adds support for MSVC /fsanitize

Change-Id: Ida80cfd7ef7ea91b2d6473fdc047cb7132cdfec6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-20 10:17:31 +00:00
Eike Ziller
70fb66f9ee COIN: Add test instructions
For now just run them without failing the precheck on failing tests.
The test results are only visible in the precheck details
on testresults.qt.io

Remove the fixed timeout of 5 seconds, since this depends on the test
setup where the tests are run, and it is not possible to override a
fixed timeout with the --timeout option of ctest.

Change-Id: Ib5f12092b64d0cf87e1213b031e1990973e18669
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-29 12:05:06 +00:00
Eike Ziller
6a296ab68a Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectplugin.cpp

Change-Id: I14030f58303839e706af892dd12a67566e3bed68
2022-05-18 13:35:47 +02:00
Eike Ziller
57a69d9d0b CMake build: Avoid endless loop if plugin does not exist
get_property fails if the target does not exist, and _dep stays at some
old value.

This leads to a) a lot of cmake backtraces with an error message that
doesn't add anything useful, and b) an endless loop in
find_dependent_plugins. Which in the end leads to 500.000 lines of
useless CMake output, repeating
"qtcreator/cmake/QtCreatorAPIInternal.cmake:340 (find_dependent_plugins)"

Skip get_property if the target doesn't exist.

Change-Id: Ic694bc05b3dce5b83220a2f5dab8f063ef692c12
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-05-10 12:57:16 +00:00
Cristian Adam
88781a003f CMake: Qt Creator Static build support
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>
2022-04-29 07:16:53 +00:00
David Schulz
ca7a18568c CMake: add ccache option
Change-Id: I482b0f3ac372f141e465b72fbcca9d8b5c5b352d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-04-11 12:29:26 +00:00
Eike Ziller
acd7445c6e Do not require CMake 3.18
Amends 46f6c5d005

Simply disable this safe-guard for < 3.18.

Change-Id: I0ae3b7520a913861c8c9f97ec7e01e5c9c00d362
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-03 09:33:05 +00:00
Thiago Macieira
46f6c5d005 CMake: require no undefined symbols
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>
2022-03-02 20:03:46 +00:00
Thiago Macieira
652639327f CMake: install the cmake files inside CMAKE_INSTALL_LIBDIR
Change-Id: I54f205f6b7314351b078fffd16d0bab2ccd81cd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-10 16:17:02 +00:00
Eike Ziller
1221552377 Require CMake 3.16 and remove workarounds
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>
2022-02-02 08:55:31 +00:00
Cristian Adam
7a0bdccadf CMake: Remove debug list source files comparison
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>
2021-11-29 10:34:18 +00:00
Joerg Kreuzberger
efdaeaba43 Add option to build QtCreator with sanitizer
Fixes: QTCREATORBUG-26318
Change-Id: I44589b5bb39958eda2329b444e4857e8f61823bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-11-05 09:03:41 +00:00
Cristian Adam
3f0a54d41c CMake: Add option to link with Qt
The named option is BUILD_LINK_WITH_QT, which when set to ON will
generate the QtCreator.ini file needed for Qt Creator to find the
installed Qt.

Change-Id: If3a47a463510fbfc90a314829378c6c4e505d2f7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-15 14:26:27 +00:00
Cristian Adam
4c07f10d33 CMake: Fix compilation build with older CMake versions
Change-Id: I86dbff49cf5d00bf75d2e32154db2d3d254e2b17
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 11:17:49 +00:00
Eike Ziller
6bc9cddb9e Merge remote-tracking branch 'origin/4.15' into 5.0
Conflicts:
	src/plugins/cmakeprojectmanager/projecttreehelper.cpp
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
2021-06-24 10:43:10 +02:00
Eike Ziller
4290c26414 CMake build: Force optimization of CPlusPlus lib
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>
2021-06-22 10:10:14 +00:00
Eike Ziller
dbd4a10d6f Merge remote-tracking branch 'origin/4.15'
Change-Id: I3d3dfa04124eed14952294c2847b9851dcb1a5fd
2021-05-25 16:26:54 +02:00
Cristian Adam
9449bfbf04 CMake: Fix build with MSVC 2019 and Qt 6.2
Qt 6.2 requires __cplusplus preprocessor set to at least 201703L

According to https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
one needs to add the compiler flag /Zc:__cplusplus

CMake doesn't set the flag, there is an issue opened at
https://gitlab.kitware.com/cmake/cmake/-/issues/18837

This flag is passed to any target that links to Qt6::Core, unless
the flags are not manually copied for some reason.

Task-number: QTCREATORBUG-25730
Change-Id: I271e85fe857b5d4ac8980f77c723e5704a8eb743
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-21 14:02:33 +00:00
Eike Ziller
759e15dbb4 CMake build: put .lib files next to .dll files for libraries
- 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>
2021-05-20 10:03:11 +00:00
Eike Ziller
79afbe7f14 COIN: Add hack to support debug info with sccache and MSVC
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>
2021-04-26 07:01:51 +00:00
Eike Ziller
4b3a746332 CMake build: Fix remaining issues with Devel package
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>
2021-04-06 10:59:27 +00:00
Eike Ziller
44d31cb687 cmake build: Disable PCH for CMake < 3.18 with GCC
https://gitlab.kitware.com/cmake/cmake/-/issues/20119 was fixed in
CMake 3.18.

Change-Id: Iad335e8c7a70069404f5c80bb3b65c0d52f82393
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-25 17:44:15 +00:00
Eike Ziller
df6967a897 Merge remote-tracking branch 'origin/4.14'
Change-Id: I6e67f23464fc14dda5a659004f0aa360d6f5d25f
2021-01-27 12:28:47 +01:00
Eike Ziller
24c03b51fd cmake build: Remove unused internal variables
Change-Id: I68ed91462c3b3c9f27c2a0a5749c373704ce467a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-25 10:44:43 +00:00
Tim Jenssen
b801a9339d Merge remote-tracking branch 'origin/4.14'
Change-Id: I70504e096be620434f38cd990c593950da8b24ba
2021-01-07 14:23:46 +00:00
Eike Ziller
c81baf1a9c cmake build: Use GNUInstallDirs for installation paths on Linux
Allows e.g. distributions to adapt to system layout.

Fixes: QTCREATORBUG-25142
Change-Id: Ia6d759514fef5a154334bc3d7221ea4b970122f2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-07 12:17:20 +00:00
Cristian Adam
4ce6058e0b CMake: Error out when dependent targets are disabled
Change-Id: I0cc1e250dbe6eca66ed5f4ddecf9d5a8acfe955a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-05 11:46:04 +00:00
Tim Jenssen
5267efc234 cmake: disable reuse pch files for static libs with MSVC
Was not able to build something against these libraries
from another "cmake project".

Change-Id: I3876d102a320b4f5324e25fd8e840c181010c2a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-23 12:26:23 +00:00
Eike Ziller
9ff91ef0d9 cmake build: Fix building with PCHs
- fix target name
- build pchs without extensions like all other targets
- require CMake 3.10 for plugins

Amends c038abb0ab

Change-Id: I0eae58a9e7ce91c0df6103790cb91a5229d06051
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-16 10:00:58 +00:00
Cristian Adam
c038abb0ab CMake Build: Fix problems with PCH and super repo
Make sure that every project will have its own precompile headers
sets.

This fixes problems with MSVC.

Change-Id: I37d58c9652f679545283907e7cad70cd579911a8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-13 18:48:18 +00:00
Eike Ziller
743877730b cmake build: Fix branding
The cmake build used IDE_ID in too many paths that are actually
not branded (yet?).

Change-Id: I019dd806975ef2205aa946bc3b27b0675233e1ea
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-09 11:04:50 +00:00
Eike Ziller
bf8879ee5c TextEditor: Add missing file to dev package
The public header "textdocumentlayout.h" includes "State" from
KSyntaxHighlighting, so we need to export that.
Since it doesn't have the ".h" extension, it doesn't get exported
automatically either. Add a generic function for adding such special
public header files.

Fixes: QTCREATORBUG-24413
Change-Id: I841e6d601df7e925f48eedcc2a28d6b43c00350e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-29 12:58:52 +00:00
Cristian Adam
3c4f7967e3 CMake Build: Allow building unittests when targets are missing
when configuring a minimal build make sure that when querying
for target properties like SOURCE_DIR the target actually exists.

Change-Id: Ib754b79be6461e3ddd4cdeb1abac123cf4535068
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-20 14:12:54 +00:00
Cristian Adam
b9cd1cc15e CMake Build: Fix PCH builds for non MSVC platforms
Ammends 2129a04c5d

Change-Id: I50fc1bf2e5ef4742243aa08a4e5ad2bfee459eb1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-10-08 10:26:21 +00:00
Cristian Adam
2129a04c5d CMake Build: Fix MSVC PCH build
Ammends 735078cd80

Change-Id: I01296641ca0681d4fef376087368e247dce011f8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-07 11:52:00 +00:00
Cristian Adam
94008aa71e CMake: Fix compilation error when QmlPlugin is not built
Ammends 6fe11f80d6

Change-Id: Ifa909d8e2946c4fdd8e2a5301bab2686a615d89a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-25 10:00:47 +00:00
Orgad Shaneh
bafc8381c6 CMake: Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
Missed in commit 52b2ca55c9

Change-Id: I1f1862e5ad8fd5a29c3e0a56adbc7960e538f441
Reviewed-by: hjk <hjk@qt.io>
2020-08-10 02:57:48 +00:00
Knud Dollereder
9a4e65cc73 CMake Build: Ensure valid destinations for generated files
- Make the build system aware that empty_pch.c/.cpp are generated files
  to prevent invalid access from _add_pch_target.
- Force the creation of the translation output directory before copying
qm files into it.

Change-Id: Iaff5e5ebdbfec7e89a47d277d95f9dec760a5b6b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-01 09:35:58 +00:00
Eike Ziller
7f44d8582b CMake build: Remove timeout for dumper tests
They take much longer, but are also optional.
Makes it possible to run via e.g. "ctest -V -R tst_debugger_dumpers"

Change-Id: I8bbda6ca36e25cd896b1f3be5d1696a27b8acc53
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-06-30 11:39:24 +00:00
Eike Ziller
d5443cea77 CMake build: Unify handling of qtc_add_... arguments
Unify handling of EXPLICIT_MOC, SKIP_AUTOMOC, EXTRA_TRANSLATIONS

Change-Id: I9f5cbe9fe6b58ec527edd5e25008153455857ed8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:19:01 +00:00
Eike Ziller
3c535503cb CMake build: Avoid using extend_qtc_target directly
Also add a extend_qtc_test which checks if the test is known.

Change-Id: Idd3b3a02ac61fce2622cb8681233cfbd96a77bc4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:26 +00:00
Eike Ziller
90612d14c7 CMake build: Move internal functions from QtCreatorAPI
Change-Id: Iade7ae7533abb8b8ed0ccba8bd246b4a734794b6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:15 +00:00