summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-04-28 13:42:58 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-04-28 13:43:04 (GMT)
commitc70482461e19543706f44eac27bc048da91efbf7 (patch)
tree81a92bab4010736ee11b557f0fc4ff3358904d94 /Source
parent3b31397dc3cbe846f6039554824d6d8aef196744 (diff)
parent158d6252cc6b01feea8f795b9007ea028765af7d (diff)
downloadCMake-c70482461e19543706f44eac27bc048da91efbf7.zip
CMake-c70482461e19543706f44eac27bc048da91efbf7.tar.gz
CMake-c70482461e19543706f44eac27bc048da91efbf7.tar.bz2
Merge topic 'ghs-file-type'
158d6252cc GHS: Set LANGUAGE type for source files Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7209
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx20
-rw-r--r--Source/cmGhsMultiTargetGenerator.h3
2 files changed, 8 insertions, 15 deletions
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index a7796c9..bf019c3 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -634,13 +634,8 @@ void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
compile = false;
}
- *fout << comment << fname << '\n';
+ *fout << comment << fname << WriteObjectLangOverride(si) << '\n';
if (compile) {
- if ("ld" != si->GetExtension() && "int" != si->GetExtension() &&
- "bsp" != si->GetExtension()) {
- WriteObjectLangOverride(*fout, si);
- }
-
this->WriteSourceProperty(*fout, si, "INCLUDE_DIRECTORIES", "-I");
this->WriteSourceProperty(*fout, si, "COMPILE_DEFINITIONS", "-D");
this->WriteSourceProperty(*fout, si, "COMPILE_OPTIONS", "");
@@ -736,17 +731,16 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandLine(
}
}
-void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
- std::ostream& fout, const cmSourceFile* sourceFile)
+std::string cmGhsMultiTargetGenerator::WriteObjectLangOverride(
+ const cmSourceFile* sourceFile)
{
+ std::string ret;
cmValue rawLangProp = sourceFile->GetProperty("LANGUAGE");
if (rawLangProp) {
- std::string sourceLangProp(*rawLangProp);
- std::string const& extension = sourceFile->GetExtension();
- if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
- fout << " -dotciscxx\n";
- }
+ ret = cmStrCat(" [", *rawLangProp, "]");
}
+
+ return ret;
}
bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 9289a72..d3e80e6 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -65,8 +65,7 @@ private:
void WriteSourceProperty(std::ostream& fout, const cmSourceFile* sf,
std::string const& propName,
std::string const& propFlag);
- static void WriteObjectLangOverride(std::ostream& fout,
- const cmSourceFile* sourceFile);
+ static std::string WriteObjectLangOverride(const cmSourceFile* sourceFile);
bool DetermineIfIntegrityApp();
cmGeneratorTarget* GeneratorTarget;