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

Method GetSwiftModuleDirectory

Source/cmGeneratorTarget.cxx:6494–6519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6492}
6493
6494std::string cmGeneratorTarget::GetSwiftModuleDirectory(
6495 std::string const& config) const
6496{
6497 // This is like the *_OUTPUT_DIRECTORY properties except that we don't have a
6498 // separate per-configuration target property.
6499 //
6500 // The property expands generator expressions. Multi-config generators append
6501 // a per-configuration subdirectory to the specified directory unless a
6502 // generator expression is used.
6503 bool appendConfigDir = true;
6504 std::string moduleDirectory;
6505
6506 if (cmValue value = this->GetProperty("Swift_MODULE_DIRECTORY")) {
6507 moduleDirectory = cmGeneratorExpression::Evaluate(
6508 *value, this->LocalGenerator, config, this);
6509 appendConfigDir = *value == moduleDirectory;
6510 }
6511 if (moduleDirectory.empty()) {
6512 moduleDirectory = this->LocalGenerator->GetCurrentBinaryDirectory();
6513 }
6514 if (appendConfigDir) {
6515 this->LocalGenerator->GetGlobalGenerator()->AppendDirectoryForConfig(
6516 "/", config, "", moduleDirectory);
6517 }
6518 return moduleDirectory;
6519}
6520
6521std::string cmGeneratorTarget::GetSwiftModulePath(
6522 std::string const& config) const

Calls 4

GetPropertyMethod · 0.95
emptyMethod · 0.45
GetGlobalGeneratorMethod · 0.45

Tested by

no test coverage detected