ENH: have the build.make file include flags.make and use the language flags

This commit is contained in:
Ken Martin 2005-08-08 15:23:45 -04:00
parent fd05925bda
commit 52f9353c45

View File

@ -329,6 +329,14 @@ cmLocalUnixMakefileGenerator3
<< depPath << depPath
<< "\n\n"; << "\n\n";
// Include the flags for the target.
flagFileName = this->Convert(flagFileName.c_str(), FULL, MAKEFILE);
ruleFileStream
<< "# Include the compile flags for this target's objects.\n"
<< m_IncludeDirective << " "
<< flagFileName
<< "\n\n";
// make sure the depend file exists // make sure the depend file exists
depPath = dir; depPath = dir;
depPath += "/depend.make"; depPath += "/depend.make";
@ -515,39 +523,18 @@ cmLocalUnixMakefileGenerator3
if (source.GetProperty("COMPILE_FLAGS")) if (source.GetProperty("COMPILE_FLAGS"))
{ {
this->AppendFlags(flags, source.GetProperty("COMPILE_FLAGS")); this->AppendFlags(flags, source.GetProperty("COMPILE_FLAGS"));
flagFileStream << "# Custom flags.\n" flagFileStream << "# Custom flags: "
<< relativeObj << "_FLAGS = " << relativeObj << "_FLAGS = "
<< source.GetProperty("COMPILE_FLAGS") << source.GetProperty("COMPILE_FLAGS")
<< "\n" << "\n"
<< "\n"; << "\n";
} }
// Add the export symbol definition for shared library objects.
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY));
if(shared)
{
flags += " -D";
if(const char* custom_export_name = target.GetProperty("DEFINE_SYMBOL"))
{
flags += custom_export_name;
}
else
{
std::string in = target.GetName();
in += "_EXPORTS";
flags += cmSystemTools::MakeCindentifier(in.c_str());
}
}
// Add language-specific flags. // Add language-specific flags.
this->AddLanguageFlags(flags, lang); std::string langFlags = "$(";
langFlags += lang;
// Add shared-library flags if needed. langFlags += "_FLAGS)";
this->AddSharedFlags(flags, lang, shared); this->AppendFlags(flags, langFlags.c_str());
// Add include directory flags.
this->AppendFlags(flags, this->GetIncludeFlags(lang));
// Get the output paths for source and object files. // Get the output paths for source and object files.
std::string sourceFile = source.GetFullPath(); std::string sourceFile = source.GetFullPath();