aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-04-04 19:30:36 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-04 19:30:36 +0300
commit3420957c73e4f6081f15ba3c26da86cf1eb36217 (patch)
treec172246a9d7edea983305c3fd74cef41c39f3321
parentbf08bba3718e8109da2ea6d235976f53c5aa8a3e (diff)
downloadmeson-3420957c73e4f6081f15ba3c26da86cf1eb36217.zip
meson-3420957c73e4f6081f15ba3c26da86cf1eb36217.tar.gz
meson-3420957c73e4f6081f15ba3c26da86cf1eb36217.tar.bz2
Move constant to module level.
-rw-r--r--mesonbuild/backend/xcodebackend.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py
index b189429..6f409be 100644
--- a/mesonbuild/backend/xcodebackend.py
+++ b/mesonbuild/backend/xcodebackend.py
@@ -24,6 +24,24 @@ from ..mesonlib import MesonException
from ..interpreter import Interpreter
INDENT = '\t'
+XCODETYPEMAP = {'c': 'sourcecode.c.c',
+ 'a': 'archive.ar',
+ 'cc': 'sourcecode.cpp.cpp',
+ 'cxx': 'sourcecode.cpp.cpp',
+ 'cpp': 'sourcecode.cpp.cpp',
+ 'c++': 'sourcecode.cpp.cpp',
+ 'm': 'sourcecode.c.objc',
+ 'mm': 'sourcecode.cpp.objcpp',
+ 'h': 'sourcecode.c.h',
+ 'hpp': 'sourcecode.cpp.h',
+ 'hxx': 'sourcecode.cpp.h',
+ 'hh': 'sourcecode.cpp.hh',
+ 'inc': 'sourcecode.c.h',
+ 'dylib': 'compiled.mach-o.dylib',
+ 'o': 'compiled.mach-o.objfile',
+ 's': 'sourcecode.asm',
+ 'asm': 'sourcecode.asm',
+ }
class PbxItem:
def __init__(self, value, comment = ''):
@@ -145,24 +163,6 @@ class XCodeBackend(backends.Backend):
self.name = 'xcode'
self.project_uid = self.environment.coredata.lang_guids['default'].replace('-', '')[:24]
self.project_conflist = self.gen_id()
- self.xcodetypemap = {'c': 'sourcecode.c.c',
- 'a': 'archive.ar',
- 'cc': 'sourcecode.cpp.cpp',
- 'cxx': 'sourcecode.cpp.cpp',
- 'cpp': 'sourcecode.cpp.cpp',
- 'c++': 'sourcecode.cpp.cpp',
- 'm': 'sourcecode.c.objc',
- 'mm': 'sourcecode.cpp.objcpp',
- 'h': 'sourcecode.c.h',
- 'hpp': 'sourcecode.cpp.h',
- 'hxx': 'sourcecode.cpp.h',
- 'hh': 'sourcecode.cpp.hh',
- 'inc': 'sourcecode.c.h',
- 'dylib': 'compiled.mach-o.dylib',
- 'o': 'compiled.mach-o.objfile',
- 's': 'sourcecode.asm',
- 'asm': 'sourcecode.asm',
- }
self.maingroup_id = self.gen_id()
self.all_id = self.gen_id()
self.all_buildconf_id = self.gen_id()
@@ -258,7 +258,7 @@ class XCodeBackend(backends.Backend):
self.write_pbxfile(self.top_level_dict, self.proj_file)
def get_xcodetype(self, fname):
- xcodetype = self.xcodetypemap.get(fname.split('.')[-1].lower())
+ xcodetype = XCODETYPEMAP.get(fname.split('.')[-1].lower())
if not xcodetype:
xcodetype = 'sourcecode.unknown'
mlog.warning(f'Unknown file type "{fname}" fallbacking to "{xcodetype}". Xcode project might be malformed.')