ENH: Moved GetSourceFileLanguage up to cmLocalGenerator.
This commit is contained in:
parent
e647052d49
commit
88702ff442
@ -2198,3 +2198,19 @@ cmLocalGenerator::GetObjectFileNameWithoutTarget(const cmSourceFile& source)
|
|||||||
// Convert to a safe name.
|
// Convert to a safe name.
|
||||||
return this->CreateSafeUniqueObjectFileName(objectName.c_str());
|
return this->CreateSafeUniqueObjectFileName(objectName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
const char*
|
||||||
|
cmLocalGenerator
|
||||||
|
::GetSourceFileLanguage(const cmSourceFile& source)
|
||||||
|
{
|
||||||
|
// Check for an explicitly assigned language.
|
||||||
|
if(const char* lang = source.GetProperty("LANGUAGE"))
|
||||||
|
{
|
||||||
|
return lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Infer the language from the source file extension.
|
||||||
|
return (this->GlobalGenerator
|
||||||
|
->GetLanguageFromExtension(source.GetSourceExtension().c_str()));
|
||||||
|
}
|
||||||
|
@ -172,6 +172,9 @@ public:
|
|||||||
/** Get the include flags for the current makefile and language. */
|
/** Get the include flags for the current makefile and language. */
|
||||||
void GetIncludeDirectories(std::vector<std::string>& dirs);
|
void GetIncludeDirectories(std::vector<std::string>& dirs);
|
||||||
|
|
||||||
|
/** Compute the language used to compile the given source file. */
|
||||||
|
const char* GetSourceFileLanguage(const cmSourceFile& source);
|
||||||
|
|
||||||
// Create a struct to hold the varibles passed into
|
// Create a struct to hold the varibles passed into
|
||||||
// ExpandRuleVariables
|
// ExpandRuleVariables
|
||||||
struct RuleVariables
|
struct RuleVariables
|
||||||
|
@ -1897,19 +1897,3 @@ void cmLocalUnixMakefileGenerator3
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
const char*
|
|
||||||
cmLocalUnixMakefileGenerator3
|
|
||||||
::GetSourceFileLanguage(const cmSourceFile& source)
|
|
||||||
{
|
|
||||||
const char* lang = source.GetProperty("LANGUAGE");
|
|
||||||
if ( lang )
|
|
||||||
{
|
|
||||||
return lang;
|
|
||||||
}
|
|
||||||
// Identify the language of the source file.
|
|
||||||
return (this->GlobalGenerator
|
|
||||||
->GetLanguageFromExtension(source.GetSourceExtension().c_str()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -174,12 +174,6 @@ public:
|
|||||||
// cleanup the name of a potential target
|
// cleanup the name of a potential target
|
||||||
std::string ConvertToMakeTarget(const char* tgt);
|
std::string ConvertToMakeTarget(const char* tgt);
|
||||||
|
|
||||||
|
|
||||||
const char* GetSourceFileLanguage(const cmSourceFile& source);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Called from command-line hook to scan dependencies. */
|
/** Called from command-line hook to scan dependencies. */
|
||||||
virtual bool ScanDependencies(const char* tgtInfo);
|
virtual bool ScanDependencies(const char* tgtInfo);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user