mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
Xcode: Set build product locations using CONFIGURATION_BUILD_DIR
Since commit 59a2265576 (Xcode: Use EFFECTIVE_PLATFORM_NAME reference in
ComputeOutputDir, 2011-08-12, v2.8.6~43^2~1) we can now set the build
products path using `CONFIGURATION_BUILD_DIR` unconditionally because we
compute the correct value even when using `EFFECTIVE_PLATFORM_NAME`.
This avoids relying on `SYMROOT` to locate the build products.
Issue: #22550
This commit is contained in:
@@ -2518,18 +2518,25 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
soName += *soversion;
|
||||
}
|
||||
|
||||
if (gtgt->CanCompileSources()) {
|
||||
std::string outDir;
|
||||
if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||
// We cannot suppress the archive, so hide it with intermediate files.
|
||||
outDir = this->GetObjectsDirectory(this->CurrentProject, configName,
|
||||
gtgt, OBJECT_LIBRARY_ARTIFACT_DIR);
|
||||
} else {
|
||||
outDir = gtgt->GetDirectory(configName);
|
||||
}
|
||||
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
|
||||
this->CreateString(outDir));
|
||||
}
|
||||
|
||||
// Set attributes to specify the proper name for the target.
|
||||
std::string pndir = this->CurrentLocalGenerator->GetCurrentBinaryDirectory();
|
||||
if (gtgt->GetType() == cmStateEnums::STATIC_LIBRARY ||
|
||||
gtgt->GetType() == cmStateEnums::SHARED_LIBRARY ||
|
||||
gtgt->GetType() == cmStateEnums::MODULE_LIBRARY ||
|
||||
gtgt->GetType() == cmStateEnums::EXECUTABLE) {
|
||||
if (!gtgt->UsesDefaultOutputDir(configName,
|
||||
cmStateEnums::RuntimeBinaryArtifact)) {
|
||||
std::string pncdir = gtgt->GetDirectory(configName);
|
||||
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
|
||||
this->CreateString(pncdir));
|
||||
}
|
||||
|
||||
if (gtgt->IsFrameworkOnApple() || gtgt->IsCFBundleOnApple()) {
|
||||
pnprefix = "";
|
||||
@@ -2539,11 +2546,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
this->CreateString(pnprefix));
|
||||
buildSettings->AddAttribute("EXECUTABLE_SUFFIX",
|
||||
this->CreateString(pnsuffix));
|
||||
} else if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||
std::string pncdir = this->GetObjectsDirectory(
|
||||
this->CurrentProject, configName, gtgt, OBJECT_LIBRARY_ARTIFACT_DIR);
|
||||
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
|
||||
this->CreateString(pncdir));
|
||||
}
|
||||
|
||||
// Store the product name for all target types.
|
||||
|
||||
Reference in New Issue
Block a user