summaryrefslogtreecommitdiffstats
path: root/Source/cmGhsMultiTargetGenerator.cxx
diff options
context:
space:
mode:
authorFred Baksik <fdk17@ftml.net>2022-04-26 02:03:21 (GMT)
committerFred Baksik <fdk17@ftml.net>2022-04-27 14:33:51 (GMT)
commit158d6252cc6b01feea8f795b9007ea028765af7d (patch)
treec57fec1286d18a4fa63f448a6883504689748ae8 /Source/cmGhsMultiTargetGenerator.cxx
parentc6ead9be834f779ae5d45841043431944d00e379 (diff)
downloadCMake-158d6252cc6b01feea8f795b9007ea028765af7d.zip
CMake-158d6252cc6b01feea8f795b9007ea028765af7d.tar.gz
CMake-158d6252cc6b01feea8f795b9007ea028765af7d.tar.bz2
GHS: Set LANGUAGE type for source files
Use gbuild project syntax for setting the language type for the file. gbuild will pick the correct compiler or tool to use. NOTE: Language names come from gbuild config files. Therefore to compile a file with the C++ compiler use "C++" not "CXX". The previous implementation was passing the C compiler a flag to compile as C++ if LANGUAGE was set to "CXX".
Diffstat (limited to 'Source/cmGhsMultiTargetGenerator.cxx')
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx20
1 files changed, 7 insertions, 13 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()