Commit 990b5f07 authored by Brad King's avatar Brad King
Browse files

Xcode: Suppress default Objective C/C++ flag -fobjc-link-runtime

Xcode projects add this link flag by default for Objective C/C++.  That
is not consistent with the Makefile and Ninja generator behavior.  Tell
Xcode not to add this flag.  Project code can add it if needed and it
will then be used for all generators.

Fixes: #19990
parent 1e68fb0c
Pipeline #151949 passed with stage
...@@ -3110,6 +3110,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( ...@@ -3110,6 +3110,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
buildSettings->AddAttribute("GCC_VERSION", buildSettings->AddAttribute("GCC_VERSION",
this->CreateString(this->GeneratorToolset)); this->CreateString(this->GeneratorToolset));
} }
if (this->GetLanguageEnabled("OBJC") || this->GetLanguageEnabled("OBJCXX")) {
// Suppress Xcode default flag '-fobjc-link-runtime' for consistency with
// Makefile and Ninja generators. Projects can add the flag if needed.
buildSettings->AddAttribute("CLANG_LINK_OBJC_RUNTIME",
this->CreateString("NO"));
}
if (this->GetLanguageEnabled("Swift")) { if (this->GetLanguageEnabled("Swift")) {
std::string swiftVersion; std::string swiftVersion;
if (const char* vers = this->CurrentMakefile->GetDefinition( if (const char* vers = this->CurrentMakefile->GetDefinition(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment