MCPcopy Create free account
hub / github.com/Kitware/CMake / AppendFortranPreprocessFlags

Method AppendFortranPreprocessFlags

Source/cmCommonTargetGenerator.cxx:85–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void cmCommonTargetGenerator::AppendFortranPreprocessFlags(
86 std::string& flags, cmSourceFile const& source,
87 PreprocessFlagsRequired requires_pp)
88{
89 std::string const srcpp = source.GetSafeProperty("Fortran_PREPROCESS");
90 cmOutputConverter::FortranPreprocess preprocess =
91 cmOutputConverter::GetFortranPreprocess(srcpp);
92 if (preprocess == cmOutputConverter::FortranPreprocess::Unset) {
93 std::string const& tgtpp =
94 this->GeneratorTarget->GetSafeProperty("Fortran_PREPROCESS");
95 preprocess = cmOutputConverter::GetFortranPreprocess(tgtpp);
96 }
97 char const* var = nullptr;
98 switch (preprocess) {
99 case cmOutputConverter::FortranPreprocess::Needed:
100 if (requires_pp == PreprocessFlagsRequired::YES) {
101 var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON";
102 }
103 break;
104 case cmOutputConverter::FortranPreprocess::NotNeeded:
105 var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF";
106 break;
107 default:
108 break;
109 }
110 if (var) {
111 this->LocalCommonGenerator->AppendCompileOptions(
112 flags, this->Makefile->GetSafeDefinition(var));
113 }
114}
115
116std::string cmCommonTargetGenerator::GetFlags(std::string const& l,
117 std::string const& config,

Callers 3

WriteObjectRuleFilesMethod · 0.80
ComputeFlagsForObjectMethod · 0.80
DetectCompilerFlagsMethod · 0.80

Calls 1

AppendCompileOptionsMethod · 0.80

Tested by

no test coverage detected