summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-04-24 12:55:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-04-24 12:55:32 (GMT)
commit3e26050a3bfdaccefdf113f35733f3f7bb256a8b (patch)
treefd0ba0a70d13318df12e5f46bdbc047c16b6e40c
parent30fd6df0b175c697f448df72ef82459e55d4ec52 (diff)
parent3071660247774cfd4291813fb470897a63b01b30 (diff)
downloadCMake-3e26050a3bfdaccefdf113f35733f3f7bb256a8b.zip
CMake-3e26050a3bfdaccefdf113f35733f3f7bb256a8b.tar.gz
CMake-3e26050a3bfdaccefdf113f35733f3f7bb256a8b.tar.bz2
Merge topic 'xcode-default-file-type'
3071660247 Xcode: Use builtin "default" file type Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9446
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx34
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake2
2 files changed, 18 insertions, 18 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 7dd5ffa..8067694 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1095,7 +1095,7 @@ std::string GetSourcecodeValueFromFileExtension(
bool& keepLastKnownFileType, const std::vector<std::string>& enabled_langs)
{
std::string ext = cmSystemTools::LowerCase(_ext);
- std::string sourcecode = "sourcecode";
+ std::string sourcecode = "default";
if (ext == "o"_s) {
keepLastKnownFileType = true;
@@ -1110,42 +1110,42 @@ std::string GetSourcecodeValueFromFileExtension(
sourcecode = "file.storyboard";
// NOLINTNEXTLINE(bugprone-branch-clone)
} else if (ext == "mm"_s && !cm::contains(enabled_langs, "OBJCXX")) {
- sourcecode += ".cpp.objcpp";
+ sourcecode = "sourcecode.cpp.objcpp";
// NOLINTNEXTLINE(bugprone-branch-clone)
} else if (ext == "m"_s && !cm::contains(enabled_langs, "OBJC")) {
- sourcecode += ".c.objc";
+ sourcecode = "sourcecode.c.objc";
} else if (ext == "swift"_s) {
- sourcecode += ".swift";
+ sourcecode = "sourcecode.swift";
} else if (ext == "plist"_s) {
- sourcecode += ".text.plist";
+ sourcecode = "sourcecode.text.plist";
} else if (ext == "h"_s) {
- sourcecode += ".c.h";
+ sourcecode = "sourcecode.c.h";
} else if (ext == "hxx"_s || ext == "hpp"_s || ext == "txx"_s ||
ext == "pch"_s || ext == "hh"_s || ext == "inl"_s) {
- sourcecode += ".cpp.h";
+ sourcecode = "sourcecode.cpp.h";
} else if (ext == "png"_s || ext == "gif"_s || ext == "jpg"_s) {
keepLastKnownFileType = true;
sourcecode = "image";
} else if (ext == "txt"_s) {
- sourcecode += ".text";
+ sourcecode = "sourcecode.text";
} else if (lang == "CXX"_s) {
- sourcecode += ".cpp.cpp";
+ sourcecode = "sourcecode.cpp.cpp";
} else if (lang == "C"_s) {
- sourcecode += ".c.c";
+ sourcecode = "sourcecode.c.c";
} else if (lang == "OBJCXX"_s) {
- sourcecode += ".cpp.objcpp";
+ sourcecode = "sourcecode.cpp.objcpp";
} else if (lang == "OBJC"_s) {
- sourcecode += ".c.objc";
+ sourcecode = "sourcecode.c.objc";
} else if (lang == "Fortran"_s) {
- sourcecode += ".fortran.f90";
+ sourcecode = "sourcecode.fortran.f90";
} else if (lang == "ASM"_s) {
- sourcecode += ".asm";
+ sourcecode = "sourcecode.asm";
} else if (ext == "metal"_s) {
- sourcecode += ".metal";
+ sourcecode = "sourcecode.metal";
} else if (ext == "mig"_s) {
- sourcecode += ".mig";
+ sourcecode = "sourcecode.mig";
} else if (ext == "tbd"_s) {
- sourcecode += ".text-based-dylib-definition";
+ sourcecode = "sourcecode.text-based-dylib-definition";
} else if (ext == "a"_s) {
keepLastKnownFileType = true;
sourcecode = "archive.ar";
diff --git a/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake
index 1847bc9..48b4680 100644
--- a/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeFileType-check.cmake
@@ -1,4 +1,4 @@
-set(expect-default "explicitFileType = sourcecode")
+set(expect-default "explicitFileType = default")
set(expect-explicit "explicitFileType = sourcecode.c.h")
set(expect-lastKnown "lastKnownFileType = sourcecode.c.h")
foreach(src default explicit lastKnown)