BUG: Removed output of GCC_XML rules when the command cannot be found.

This commit is contained in:
Brad King 2001-04-27 14:52:16 -04:00
parent 2f42d7ffcb
commit 244892bc3b
1 changed files with 22 additions and 16 deletions

View File

@ -73,9 +73,10 @@ bool cmCablePackageCommand::Invoke(std::vector<std::string>& args)
{
// We must add a custom rule to cause the cable_config.xml to be re-built
// when it is removed. Rebuilding it means re-running CMake.
std::string cMakeLists = m_Makefile->GetStartDirectory();
std::string cMakeLists = "\"";
cMakeLists += m_Makefile->GetStartDirectory();
cMakeLists += "/";
cMakeLists += "CMakeLists.txt";
cMakeLists += "CMakeLists.txt\"";
std::string command;
#if defined(_WIN32) && !defined(__CYGWIN__)
@ -147,9 +148,13 @@ bool cmCablePackageCommand::Invoke(std::vector<std::string>& args)
{
std::string command = "${GCCXML}";
m_Makefile->ExpandVariablesInString(command);
// Only add the rule if GCC-XML is available.
if((command != "") && (command != "${GCCXML}"))
{
std::vector<std::string> depends;
depends.push_back(command);
std::string input = "Cxx/"+m_PackageName+"_cxx.cxx";
std::string input = m_Makefile->GetStartOutputDirectory();
input = input + "/Cxx/"+m_PackageName+"_cxx.cxx";
std::string output = "Cxx/"+m_PackageName+"_cxx.xml";
command = "\""+command+"\" ${CXX_FLAGS} -fsyntax-only -fxml=" + output + " -c " + input;
@ -162,6 +167,7 @@ bool cmCablePackageCommand::Invoke(std::vector<std::string>& args)
depends,
outputs, m_TargetName.c_str());
}
}
// add the source list to the target
m_Makefile->GetTargets()[m_TargetName.c_str()].GetSourceLists().push_back(m_PackageName);