diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-20 20:39:22 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-04-21 17:16:01 +0300 |
commit | 674538d8c98a68e77c8629e95c86592d35663dd5 (patch) | |
tree | 1503dc9ccfbd63dc2cc414a37f29932ada9dae32 | |
parent | b42a5e21d0387f9f978a40c842d211e455b67557 (diff) | |
download | meson-674538d8c98a68e77c8629e95c86592d35663dd5.zip meson-674538d8c98a68e77c8629e95c86592d35663dd5.tar.gz meson-674538d8c98a68e77c8629e95c86592d35663dd5.tar.bz2 |
Xcode: put all include dirs via a property rather than a cmd line arg.
-rw-r--r-- | mesonbuild/backend/backends.py | 8 | ||||
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 15 |
2 files changed, 15 insertions, 8 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 04f3d23..734a7e4 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1169,7 +1169,7 @@ class Backend: def get_normpath_target(self, source) -> str: return os.path.normpath(source) - def get_custom_target_dir_include_args(self, target, compiler, *, absolute_path=False): + def get_custom_target_dirs(self, target, compiler, *, absolute_path=False): custom_target_include_dirs = [] for i in target.get_generated_sources(): # Generator output goes into the target private dir which is @@ -1184,11 +1184,15 @@ class Backend: idir = os.path.join(self.environment.get_build_dir(), idir) if idir not in custom_target_include_dirs: custom_target_include_dirs.append(idir) + return custom_target_include_dirs + + def get_custom_target_dir_include_args(self, target, compiler, *, absolute_path=False): incs = [] - for i in custom_target_include_dirs: + for i in self.get_custom_target_dirs(target, compiler, absolute_path=absolute_path): incs += compiler.get_include_args(i, False) return incs + def eval_custom_target_command(self, target, absolute_outputs=False): # We want the outputs to be absolute only when using the VS backend # XXX: Maybe allow the vs backend to use relative paths too? diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index ce7a602..d9ea75b 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1406,9 +1406,6 @@ class XCodeBackend(backends.Backend): # 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 += compiler.get_include_args(self.get_target_private_dir_abs(target), is_system=False) - lang_cargs += self.get_build_dir_include_args(target, compiler, absolute_path=True) - lang_cargs += self.get_source_dir_include_args(target, compiler, absolute_path=True) lang_cargs += self.get_custom_target_dir_include_args(target, compiler, absolute_path=True) langargs[langname] = args langargs[langname] += lang_cargs @@ -1448,12 +1445,18 @@ class XCodeBackend(backends.Backend): settings_dict.add_item('GCC_PREFIX_HEADER', f'"$(PROJECT_DIR)/{relative_pch_path}"') settings_dict.add_item('GCC_PREPROCESSOR_DEFINITIONS', '""') settings_dict.add_item('GCC_SYMBOLS_PRIVATE_EXTERN', 'NO') + header_arr = PbxArray() + unquoted_headers = [] + unquoted_headers.append(self.get_target_private_dir_abs(target)) + unquoted_headers.append(os.path.join(self.environment.get_build_dir(), target.get_subdir())) + unquoted_headers.append(os.path.join(self.environment.get_source_dir(), target.get_subdir())) if headerdirs: - header_arr = PbxArray() for i in headerdirs: i = os.path.normpath(i) - header_arr.add_item(f'"\\"{i}\\""') - settings_dict.add_item('HEADER_SEARCH_PATHS', header_arr) + unquoted_headers.append(i) + for i in unquoted_headers: + header_arr.add_item(f'"\\"{i}\\""') + settings_dict.add_item('HEADER_SEARCH_PATHS', header_arr) settings_dict.add_item('INSTALL_PATH', f'"{install_path}"') settings_dict.add_item('LIBRARY_SEARCH_PATHS', '""') if isinstance(target, build.SharedModule): |