1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

prop_sf/OBJECT_NAME: no-op for the FASTBuild and Xcode generators

There's no control over the object base name implemented in the
FASTBuild generator. Rather than expecting some half-supported behavior,
just ignore it completely there.

Similarly, Xcode ends up making its own object paths internally
regardless of what CMake would like.
This commit is contained in:
Ben Boeckel
2025-09-04 13:40:16 -04:00
parent 9ef99353cb
commit 84372ce0b5
6 changed files with 24 additions and 1 deletions

View File

@@ -24,3 +24,7 @@ allow for context-sensitive (i.e., configuration-dependent) expressions.
* Generated PCH source files (``cmake_pch``)
* Generated Unity compilation files (``unity_``)
* Qt autogen sources (``moc_compilations.cpp``)
.. note::
The :generator:`FASTBuild` and :generator:`Xcode` generators do not support
this property and it is ignored.

View File

@@ -356,6 +356,8 @@ public:
bool IsMultiConfig() const override { return false; }
bool SupportsCustomObjectNames() const override { return false; }
void ComputeTargetObjectDirectory(cmGeneratorTarget*) const override;
void AppendDirectoryForConfig(std::string const& prefix,
std::string const& config,

View File

@@ -174,6 +174,8 @@ public:
return false;
}
virtual bool SupportsCustomObjectNames() const { return true; }
virtual bool SupportsBuildDatabase() const { return false; }
bool AddBuildDatabaseTargets();
void AddBuildDatabaseFile(std::string const& lang, std::string const& config,

View File

@@ -116,6 +116,8 @@ public:
bool ShouldStripResourcePath(cmMakefile*) const override;
bool SupportsCustomObjectNames() const override { return false; }
/**
* Used to determine if this generator supports DEPFILE option.
*/

View File

@@ -4336,7 +4336,8 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
useShortObjectNames = *forceShortObjectName;
}
if (!useShortObjectNames) {
if (!useShortObjectNames &&
this->GetGlobalGenerator()->SupportsCustomObjectNames()) {
auto customName = this->GetCustomObjectFileName(source);
if (!customName.empty()) {
auto ext = this->GlobalGenerator->GetLanguageOutputExtension(source);

View File

@@ -8,6 +8,18 @@ if (RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATC
return ()
endif ()
if (RunCMake_GENERATOR STREQUAL "FASTBuild")
# FASTBuild does not offer full control over object paths. Just skip all
# tests rather than expecting some half-supported behavior.
return ()
endif ()
if (RunCMake_GENERATOR STREQUAL "Xcode")
# Xcode does not offer full control over object paths. Just skip all tests
# rather than expecting some half-supported behavior.
return ()
endif ()
function(run_build_test case)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Debug)