diff options
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r-- | Source/cmCommonTargetGenerator.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx index 8d5ce7ed0..129ef4b0b 100644 --- a/Source/cmCommonTargetGenerator.cxx +++ b/Source/cmCommonTargetGenerator.cxx @@ -101,7 +101,8 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags( } void cmCommonTargetGenerator::AppendFortranPreprocessFlags( - std::string& flags, cmSourceFile const& source) + std::string& flags, cmSourceFile const& source, + PreprocessFlagsRequired requires_pp) { const std::string srcpp = source.GetSafeProperty("Fortran_PREPROCESS"); cmOutputConverter::FortranPreprocess preprocess = @@ -114,7 +115,9 @@ void cmCommonTargetGenerator::AppendFortranPreprocessFlags( const char* var = nullptr; switch (preprocess) { case cmOutputConverter::FortranPreprocess::Needed: - var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON"; + if (requires_pp == PreprocessFlagsRequired::YES) { + var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON"; + } break; case cmOutputConverter::FortranPreprocess::NotNeeded: var = "CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF"; |