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

Method GetSwiftCompileMode

Source/cmLocalGenerator.cxx:3016–3042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3014}
3015
3016cm::optional<cmSwiftCompileMode> cmLocalGenerator::GetSwiftCompileMode(
3017 cmGeneratorTarget const* target, std::string const& config)
3018{
3019 cmMakefile const* mf = this->GetMakefile();
3020 cmValue const swiftCompileModeDefault =
3021 mf->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT");
3022 if (!cmNonempty(swiftCompileModeDefault)) {
3023 return {};
3024 }
3025 cmValue swiftCompileMode = target->GetProperty("Swift_COMPILATION_MODE");
3026 if (!swiftCompileMode) {
3027 swiftCompileMode = swiftCompileModeDefault;
3028 }
3029
3030 std::string const expandedCompileMode =
3031 cmGeneratorExpression::Evaluate(*swiftCompileMode, this, config, target);
3032 if (expandedCompileMode == "wholemodule") {
3033 return cmSwiftCompileMode::Wholemodule;
3034 }
3035 if (expandedCompileMode == "singlefile") {
3036 return cmSwiftCompileMode::Singlefile;
3037 }
3038 if (expandedCompileMode == "incremental") {
3039 return cmSwiftCompileMode::Incremental;
3040 }
3041 return cmSwiftCompileMode::Unknown;
3042}
3043
3044bool cmLocalGenerator::IsSplitSwiftBuild() const
3045{

Callers 3

GetTargetCompileFlagsMethod · 0.95
CreateBuildSettingsMethod · 0.80

Calls 4

GetMakefileMethod · 0.95
cmNonemptyFunction · 0.85
GetDefinitionMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected