Bladeren bron

Xcode: Explicitly turn off signing in try_compile projects

Fixes: #18407, #20571, #20688
Brad King 5 jaren geleden
bovenliggende
commit
d3a64c4e3f
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 6 0
      Source/cmGlobalXCodeGenerator.cxx

+ 6 - 0
Source/cmGlobalXCodeGenerator.cxx

@@ -3406,6 +3406,12 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   std::string symroot = cmStrCat(root->GetCurrentBinaryDirectory(), "/build");
   std::string symroot = cmStrCat(root->GetCurrentBinaryDirectory(), "/build");
   buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot));
   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) {
   for (auto& config : configs) {
     cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
     cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);