|
@@ -1947,15 +1947,6 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- auto getTargetPropertyOrDefault =
|
|
|
- [](cmGeneratorTarget const& target, std::string const& property,
|
|
|
- std::string defaultValue) -> std::string {
|
|
|
- if (cmValue value = target.GetProperty(property)) {
|
|
|
- return *value;
|
|
|
- }
|
|
|
- return defaultValue;
|
|
|
- };
|
|
|
-
|
|
|
std::string const language = "Swift";
|
|
|
std::string const objectDir = this->ConvertToNinjaPath(
|
|
|
cmStrCat(this->GeneratorTarget->GetSupportDirectory(),
|
|
@@ -1971,12 +1962,12 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
|
|
|
vars.emplace("restat", "1");
|
|
|
|
|
|
std::string const moduleName =
|
|
|
- getTargetPropertyOrDefault(target, "Swift_MODULE_NAME", target.GetName());
|
|
|
- std::string const moduleDirectory = getTargetPropertyOrDefault(
|
|
|
- target, "Swift_MODULE_DIRECTORY",
|
|
|
+ target.GetPropertyOrDefault("Swift_MODULE_NAME", target.GetName());
|
|
|
+ std::string const moduleDirectory = target.GetPropertyOrDefault(
|
|
|
+ "Swift_MODULE_DIRECTORY",
|
|
|
target.LocalGenerator->GetCurrentBinaryDirectory());
|
|
|
- std::string const moduleFilename = getTargetPropertyOrDefault(
|
|
|
- target, "Swift_MODULE", cmStrCat(moduleName, ".swiftmodule"));
|
|
|
+ std::string const moduleFilename = target.GetPropertyOrDefault(
|
|
|
+ "Swift_MODULE", cmStrCat(moduleName, ".swiftmodule"));
|
|
|
std::string const moduleFilepath =
|
|
|
this->ConvertToNinjaPath(cmStrCat(moduleDirectory, '/', moduleFilename));
|
|
|
|
|
@@ -2097,12 +2088,12 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement(
|
|
|
// swiftmodule to the ninja build graph.
|
|
|
if (isImportableTarget(*dep)) {
|
|
|
std::string const depModuleName =
|
|
|
- getTargetPropertyOrDefault(*dep, "Swift_MODULE_NAME", dep->GetName());
|
|
|
- std::string const depModuleDir = getTargetPropertyOrDefault(
|
|
|
- *dep, "Swift_MODULE_DIRECTORY",
|
|
|
+ dep->GetPropertyOrDefault("Swift_MODULE_NAME", dep->GetName());
|
|
|
+ std::string const depModuleDir = dep->GetPropertyOrDefault(
|
|
|
+ "Swift_MODULE_DIRECTORY",
|
|
|
dep->LocalGenerator->GetCurrentBinaryDirectory());
|
|
|
- std::string const depModuleFilename = getTargetPropertyOrDefault(
|
|
|
- *dep, "Swift_MODULE", cmStrCat(depModuleName, ".swiftmodule"));
|
|
|
+ std::string const depModuleFilename = dep->GetPropertyOrDefault(
|
|
|
+ "Swift_MODULE", cmStrCat(depModuleName, ".swiftmodule"));
|
|
|
std::string const depModuleFilepath = this->ConvertToNinjaPath(
|
|
|
cmStrCat(depModuleDir, '/', depModuleFilename));
|
|
|
objBuild.ImplicitDeps.push_back(depModuleFilepath);
|