cmSourceFile::GetProperty: return cmProp

This commit is contained in:
Vitaly Stakhovsky
2020-04-14 10:00:00 -04:00
committed by Brad King
parent fc223f9860
commit e64fa5f1b6
18 changed files with 191 additions and 181 deletions
+14 -13
View File
@@ -1445,14 +1445,15 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
needfc = true;
}
const std::string COMPILE_FLAGS("COMPILE_FLAGS");
if (const char* cflags = sf.GetProperty(COMPILE_FLAGS)) {
fc.CompileFlags = genexInterpreter.Evaluate(cflags, COMPILE_FLAGS);
if (cmProp cflags = sf.GetProperty(COMPILE_FLAGS)) {
fc.CompileFlags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS);
needfc = true;
}
const std::string COMPILE_OPTIONS("COMPILE_OPTIONS");
if (const char* coptions = sf.GetProperty(COMPILE_OPTIONS)) {
if (cmProp coptions = sf.GetProperty(COMPILE_OPTIONS)) {
lg->AppendCompileOptions(
fc.CompileFlags, genexInterpreter.Evaluate(coptions, COMPILE_OPTIONS));
fc.CompileFlags,
genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS));
needfc = true;
}
// Add precompile headers compile options.
@@ -1473,7 +1474,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
if (lg->FortranProject) {
switch (cmOutputConverter::GetFortranFormat(
sf.GetProperty("Fortran_FORMAT"))) {
sf.GetSafeProperty("Fortran_FORMAT"))) {
case cmOutputConverter::FortranFormatFixed:
fc.CompileFlags = "-fixed " + fc.CompileFlags;
needfc = true;
@@ -1487,26 +1488,26 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
}
}
const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
if (const char* cdefs = sf.GetProperty(COMPILE_DEFINITIONS)) {
fc.CompileDefs = genexInterpreter.Evaluate(cdefs, COMPILE_DEFINITIONS);
if (cmProp cdefs = sf.GetProperty(COMPILE_DEFINITIONS)) {
fc.CompileDefs = genexInterpreter.Evaluate(*cdefs, COMPILE_DEFINITIONS);
needfc = true;
}
std::string defPropName = cmStrCat("COMPILE_DEFINITIONS_", configUpper);
if (const char* ccdefs = sf.GetProperty(defPropName)) {
if (cmProp ccdefs = sf.GetProperty(defPropName)) {
fc.CompileDefsConfig =
genexInterpreter.Evaluate(ccdefs, COMPILE_DEFINITIONS);
genexInterpreter.Evaluate(*ccdefs, COMPILE_DEFINITIONS);
needfc = true;
}
const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES");
if (const char* cincs = sf.GetProperty(INCLUDE_DIRECTORIES)) {
fc.IncludeDirs = genexInterpreter.Evaluate(cincs, INCLUDE_DIRECTORIES);
if (cmProp cincs = sf.GetProperty(INCLUDE_DIRECTORIES)) {
fc.IncludeDirs = genexInterpreter.Evaluate(*cincs, INCLUDE_DIRECTORIES);
needfc = true;
}
// Check for extra object-file dependencies.
if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> depends = cmExpandedList(deps);
if (cmProp deps = sf.GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> depends = cmExpandedList(*deps);
const char* sep = "";
for (const std::string& d : depends) {
fc.AdditionalDeps += sep;