summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2011-01-14 23:16:11 (GMT)
committerBrad King <brad.king@kitware.com>2011-04-25 17:27:58 (GMT)
commit5674844de4b74d0b66cfc6b8237e631702c43637 (patch)
tree509512a733230141934d6464982d5438068f2602 /Source
parentfe07b0557b0b6cc47c29547d9c1d30a2b440fcd8 (diff)
downloadCMake-5674844de4b74d0b66cfc6b8237e631702c43637.zip
CMake-5674844de4b74d0b66cfc6b8237e631702c43637.tar.gz
CMake-5674844de4b74d0b66cfc6b8237e631702c43637.tar.bz2
make compile command output optional
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx3
2 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 92f87c9..54f2b03 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -216,7 +216,7 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand(
{
std::string commandDatabaseName =
std::string(this->GetCMakeInstance()->GetHomeOutputDirectory())
- + "/cxx_commands.json";
+ + "/compile_commands.json";
this->CommandDatabase =
new cmGeneratedFileStream(commandDatabaseName.c_str());
*this->CommandDatabase << "[" << std::endl;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index e5df2f4..6d3fbe0 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -671,7 +671,8 @@ cmMakefileTargetGenerator
std::vector<std::string> compileCommands;
cmSystemTools::ExpandListArgument(compileRule, compileCommands);
- if (lang_is_c_or_cxx && compileCommands.size() == 1)
+ if (this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS") &&
+ lang_is_c_or_cxx && compileCommands.size() == 1)
{
std::string compileCommand = compileCommands[0];
this->LocalGenerator->ExpandRuleVariables(compileCommand, vars);