From 5295b988aff28b77a4127d6a87eb1840b4c46a27 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 3 Feb 2025 15:30:49 -0800 Subject: [PATCH] backend/xcode: replace use of CustomTarget method with open code This function isn't supposed to be used for build targets, so just open code this instead. This also gets xcode fully type safe. --- mesonbuild/backend/xcodebackend.py | 3 ++- run_mypy.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index e85c46c56532..c74d4cb6358f 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1747,7 +1747,8 @@ def generate_single_build_target( # 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. - cti_args = self.get_custom_target_dir_include_args(target, compiler, absolute_path=True) + cti_args.append('-I{}'.format(os.path.join(self.environment.source_dir, target.subdir))) + cti_args.append('-I{}'.format(os.path.join(self.environment.build_dir, target.subdir))) # Xcode cannot handle separate compilation flags for C and ObjectiveC. They are both # put in OTHER_CFLAGS. Same with C++ and ObjectiveC++. if lang == 'objc': diff --git a/run_mypy.py b/run_mypy.py index 358fa4d585f4..5a22cfffafa7 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -37,6 +37,7 @@ 'mesonbuild/backend/vs2017backend.py', 'mesonbuild/backend/vs2019backend.py', 'mesonbuild/backend/vs2022backend.py', + 'mesonbuild/backend/xcodebackend.py', # 'mesonbuild/coredata.py', 'mesonbuild/depfile.py', 'mesonbuild/envconfig.py',