Commit 5674844d authored by Manuel Klimek's avatar Manuel Klimek Committed by Brad King

make compile command output optional

parent fe07b055
......@@ -50,6 +50,9 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
IF(DEFINED CMAKE_RULE_MESSAGES)
SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation."
)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment