Browse Source

Merge topic 'xcode-try_compile-no-sign-backport' into release-3.18

97d581b25d Xcode: Explicitly turn off signing in try_compile projects

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5117
Brad King 5 years ago
parent
commit
b6da87c13f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Source/cmGlobalXCodeGenerator.cxx

+ 6 - 0
Source/cmGlobalXCodeGenerator.cxx

@@ -3158,6 +3158,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   std::string symroot = cmStrCat(root->GetCurrentBinaryDirectory(), "/build");
   buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot));
 
+  // Inside a try_compile project, do not require signing on any platform.
+  if (this->CMakeInstance->GetIsInTryCompile()) {
+    buildSettings->AddAttribute("CODE_SIGNING_ALLOWED",
+                                this->CreateString("NO"));
+  }
+
   for (auto& config : configs) {
     cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);