浏览代码

Xcode: Drop CMAKE_INTDIR= definition in Swift targets

Xcode 14.0 warns that Swift doesn't support definition values.
Therefore `CMAKE_INTDIR` is not useful to Swift sources.  Drop it.
Brad King 3 年之前
父节点
当前提交
12c6fec6b4
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      Source/cmGlobalXCodeGenerator.cxx

+ 7 - 2
Source/cmGlobalXCodeGenerator.cxx

@@ -2393,8 +2393,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
 
   // Add preprocessor definitions for this target and configuration.
   BuildObjectListOrString ppDefs(this, true);
-  this->AppendDefines(
-    ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
+  if (languages.count("Swift")) {
+    // FIXME: Xcode warns that Swift does not support definition values.
+    // C/CXX sources mixed in Swift targets will not see CMAKE_INTDIR.
+  } else {
+    this->AppendDefines(
+      ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
+  }
   if (const std::string* exportMacro = gtgt->GetExportMacro()) {
     // Add the export symbol definition for shared library objects.
     this->AppendDefines(ppDefs, exportMacro->c_str());