summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-07 13:22:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-01-07 13:22:27 (GMT)
commit1cbbfbc78f7d22b89ccbce4cb5a4961afe943886 (patch)
tree5d80b2e8842bd72b834b55af7884bbbf0a899c50 /Source
parent455d016863534e748325ea01b3b33772de89798a (diff)
parenta742b5d137d0855430a044dc4237de5aabfb08b4 (diff)
downloadCMake-1cbbfbc78f7d22b89ccbce4cb5a4961afe943886.zip
CMake-1cbbfbc78f7d22b89ccbce4cb5a4961afe943886.tar.gz
CMake-1cbbfbc78f7d22b89ccbce4cb5a4961afe943886.tar.bz2
Merge topic 'export-compile-commands-per-target'
a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5651
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmTarget.cxx1
3 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0f91d6d..c33fabd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -898,7 +898,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
cmExpandList(compileRule, compileCommands);
}
- if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") &&
+ if (this->GeneratorTarget->GetPropertyAsBool("EXPORT_COMPILE_COMMANDS") &&
lang_can_export_cmds && compileCommands.size() == 1) {
std::string compileCommand = compileCommands[0];
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 18c9d82..f1bd760 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1536,7 +1536,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
std::string const& objectFileDir, std::string const& flags,
std::string const& defines, std::string const& includes)
{
- if (!this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS")) {
+ if (!this->GeneratorTarget->GetPropertyAsBool("EXPORT_COMPILE_COMMANDS")) {
return;
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2fd6063..1fd2355 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -383,6 +383,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
initProp("UNITY_BUILD");
initProp("UNITY_BUILD_UNIQUE_ID");
initProp("OPTIMIZE_DEPENDENCIES");
+ initProp("EXPORT_COMPILE_COMMANDS");
initPropValue("UNITY_BUILD_BATCH_SIZE", "8");
initPropValue("UNITY_BUILD_MODE", "BATCH");
initPropValue("PCH_WARN_INVALID", "ON");