diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-24 19:44:16 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-25 15:35:13 +0300 |
commit | 0e4c358f357e23ad4d2f86d6801da2648dbf8ec2 (patch) | |
tree | 550f62aca8e2be8c8d0c351d3b69deed2c1461d6 /mesonbuild/backend/xcodebackend.py | |
parent | 8f2155f4f70123f17ebe19daebd6faf9a385c36d (diff) | |
download | meson-0e4c358f357e23ad4d2f86d6801da2648dbf8ec2.zip meson-0e4c358f357e23ad4d2f86d6801da2648dbf8ec2.tar.gz meson-0e4c358f357e23ad4d2f86d6801da2648dbf8ec2.tar.bz2 |
Xcode: add objective C flags to plain C because Xcode requires it.
Diffstat (limited to 'mesonbuild/backend/xcodebackend.py')
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index dca045f..ff0bae7 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1445,14 +1445,21 @@ class XCodeBackend(backends.Backend): targs = target.get_extra_args(lang) args = warn_args + std_args + pargs + gargs + targs if args: - langname = LANGNAMEMAP[lang] lang_cargs = cargs if compiler and target.implicit_include_directories: # It is unclear what is the cwd when xcode runs. -I. does not seem to # add the root build dir to the search path. So add an absolute path instead. # This may break reproducible builds, in which case patches are welcome. lang_cargs += self.get_custom_target_dir_include_args(target, compiler, absolute_path=True) - langargs[langname] = args + # Xcode can not handle separate compilation flags for C and ObjectiveC. They are both + # put in OTHER_CFLAGS. + if lang == 'objc': + lang = 'c' + langname = LANGNAMEMAP[lang] + if langname in langargs: + langargs[langname] += args + else: + langargs[langname] = args langargs[langname] += lang_cargs symroot = os.path.join(self.environment.get_build_dir(), target.subdir) bt_dict = PbxDict() |