forked from qt-creator/qt-creator
CMakePM: Only set CMAKE_COLOR_DIAGNOSTICS for new projects
Amends d7f44cdd24
By having CMAKE_COLOR_DIAGNOSTICS in initial parameters we make sure
that imported projects will not get rebuild.
Having CMAKE_COLOR_DIAGNOSTICS as an environment variable will cause
CMake to set CMAKE_COLOR_DIAGNOSTICS as parameter, and in combination
with CLICOLOR_FORCE would cause on gcc/clang the modification of the
compiler command lines.
See https://cmake.org/cmake/help/latest/variable/
CMAKE_COLOR_DIAGNOSTICS.html for details.
Fixes: QTCREATORBUG-32196
Change-Id: Ia5aa72695ecf7b605bc99caf5b46b2d2f9c6ed20
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -112,7 +112,6 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem)
|
|||||||
environment.set("ICECC", "no");
|
environment.set("ICECC", "no");
|
||||||
|
|
||||||
environment.set("QTC_RUN", "1");
|
environment.set("QTC_RUN", "1");
|
||||||
environment.setFallback("CMAKE_COLOR_DIAGNOSTICS", "1");
|
|
||||||
environment.setFallback("CLICOLOR_FORCE", "1");
|
environment.setFallback("CLICOLOR_FORCE", "1");
|
||||||
|
|
||||||
cmakeToolId = CMakeKitAspect::cmakeToolId(k);
|
cmakeToolId = CMakeKitAspect::cmakeToolId(k);
|
||||||
|
@@ -1187,6 +1187,9 @@ static CommandLine defaultInitialCMakeCommand(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CMake should output colors by default
|
||||||
|
cmd.addArg("-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON");
|
||||||
|
|
||||||
cmd.addArgs(CMakeConfigurationKitAspect::toArgumentsList(k));
|
cmd.addArgs(CMakeConfigurationKitAspect::toArgumentsList(k));
|
||||||
cmd.addArgs(CMakeConfigurationKitAspect::additionalConfiguration(k), CommandLine::Raw);
|
cmd.addArgs(CMakeConfigurationKitAspect::additionalConfiguration(k), CommandLine::Raw);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user