Lifetime extension via const-ref only applies to functions that return
by value. For those that already return by reference (such as
QList::constLast()), no extension happens and we end up with a dangling
reference.
cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference]
cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList<ProjectExplorer::BuildStep*>::constLast()’
Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The task-number below has a sample where CMAKE_C|XX_COMPILER was set to
"cl.exe" and the CMAKE_PREFIX_PATH was set to "C:/Qt//6.5.0/
msvc2019_64".
These values would cause "red" values in the CMake configuration, which
is not that nice.
This patchset will make sure that everything is nicely configured.
Task-number: QTCREATORBUG-28982
Change-Id: I21289d1936ef075ce02364fc675709c52c76c3ed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The BuildDirectory is now assumed to be on the build device.
The default build directory template path is resolved against the
project path mapped to the build directory.
Change-Id: Ie1d147d135e9e551f2ac46cbec583374d524d2d7
Reviewed-by: David Schulz <david.schulz@qt.io>
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).
Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.
Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
QTC_KIT_DEFAULT_CONFIG_HASH is used to match CMake presets kits and
should not pass to the CMake configuration.
Change-Id: I27caedf03f94c1e864f16d1f735e2edbabbfe871
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The crash could be reproduced by opening a project, clicking the "Kit
Configuration" button in the build configuration, closing that dialog,
opening it again, opening the settings from the "Manage" button for the
CMake tools, and closing the settings dialog.
The "KitAspectWidget"s are not really widgets, and by default do not get
a parent, or are otherwise lifetime managed. When "they" are added to a
layout, actually only their widget members are added to the GUI. When
opening and closing the "Kit Configuration" dialog, the widgets were
deleted, but the KitAspectWidget instances were leaked and lived on, the
CMakeKitAspectWidget referencing a now deleted QComboBox, and still
being connected to the CMakeToolManager's signals, which subsequented
crashed when these were sent.
Fixes: QTCREATORBUG-28740
Change-Id: I36db3b6596ef21cc01dc877bca92b9961c0606b9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
... out of SessionManager.
The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.
Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.
Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.
Found with regular expression: (?<!(Tr::)|([\w]))tr\(
Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
By copying the ${IDE:ResourcePath}/package-manager to
${buildDir}/.qtc/ the problem with hardcoding paths
to old an Qt Creator version can no longer occur.
This also fixes the issue with remote projects by reffering
to the code residing on the host.
With the above issues fixed, enable "Package manager auto setup"
by default.
Change-Id: Ia49654a3b9059f83886e64d065019b2d55e9299c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
EnvironmentAspect is used in the Run configuration page.
For a configuration not using presets the "Build Environment" will be
used by default. This is the pre Qt Creator 9 behavior.
With presets "System Environment" is used, which allows the environment
sepparation of configure and build steps.
Fixes: QTCREATORBUG-28513
Change-Id: Ie65c0a5ac67355642460fca9fc618a1d29f4b1bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In the configure environment for MSVC toolchains.
The MSVC toolchain actually overwrites the PATH environment (triggered
via kit()->addToBuildEnvironment(result)), which it shouldn't.
But this is a minimal fix for Qt Creator 9.0 that also is in line with
what BuildConfiguration::baseEnvironment() does.
Fixes: QTCREATORBUG-28685
Change-Id: I0cb8e3c84419403672175bd581c16d90902e23ba
Reviewed-by: David Schulz <david.schulz@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files
starting the NDK version r23b. We should set ANDROID_PLATFORM instead,
to specify the NDK platform version, that exists in all NDK versions
supported by Qt. Also the ANDROID_PLATFORM variable expects the
'android-xx' format as a value, so avoid cutting the 'android-' prefix
when adding the value to the CMake configure string.
Fixes: QTCREATORBUG-28624
Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This allows a project to be properly configured with Qt Creator 9 when
the build environment had user defined changes.
Qt Creator version prior to 9 had one setting for both configure and
build steps.
Fixes: QTCREATORBUG-28372
Change-Id: I0da8065085bd6628ba75923c17b46648eb031801
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Is part of CMakePrests v3, and slipped at the implementation time.
Task-number: QTCREATORBUG-24555
Change-Id: Id3ce90c0a979d44287fc03ae1dd49a64e964cdf2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Shortens the "Run CMake" button and the cmake variables
tab header to make them easier to read on wide monitors
Change-Id: I2579a8fa1c2899ae94f9c4a72c4188dc61ecd5f9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Previously, if you have a filter set in the CMake Settings
variable list, adding a new one would immediately hide it,
as the text filter hides the "<UNSET>" key. This made it look
like the adding failed.
With this change, new Variables are always shown so
they stay editable to user.
Change-Id: I9c2eb7f9983b23e1cd3aa50f589142551caaf56f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Restrict the build types only if CMAKE_BUILD_TYPE or
CMAKE_CONFIGURATION_TYPES cache variables are set.
Change-Id: Ib88dcd5d4a0fca86f86e95815edff1116f896324
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMakePresets v3 relax the requirement of having the buildDirectory
specified.
This way Qt Creator should use its own mechanism of specifying the build
directory.
Change-Id: I6ba69e6a03cdc058e7b8fa540a6fc564356aba63
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
If a preset has a build directory set, that build directory and build
type should be displayed in the initial configuration dialog.
Change-Id: I884471cb4d482c92ab091a4043d642828318b4d2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
When trying to configure a CMake project on a remote linux device,
there's currently PATH=/some/local/dir/for/ninja added on the ssh
command line, which won't work with the remote cmake.
Change-Id: I97adb58e4c8b33f74edcc37a7b2cfb00c764b829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
If certain tools are not in the systems base PATH, as can be the case
on macOS where Ninja might be located in /usr/local/bin, the initial run
of cmake for a new/clean project would fail as the PATH (and the rest
of the environment variables) would not be set for a freshly initialized
CMakeBuildConfiguration.
This change fixes that by calling
updateAndEmitConfigureEnvironmentChanged at the end of the build system
initialization.
Change-Id: Ib2ebe4da60a6284548eabed124240212178c67e1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.
Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>