diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-21 12:05:38 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-01-28 05:09:51 +0530 |
commit | 2bb58c909fd80cc8ce053b5f1b6565bd28a416d2 (patch) | |
tree | b6510bc5f6585087e18f90f23b0c2fd1d4ac1150 /mesonbuild/build.py | |
parent | dbcbf19ecea9d07d264dbbc1cd87ab22393be8a7 (diff) | |
download | meson-2bb58c909fd80cc8ce053b5f1b6565bd28a416d2.zip meson-2bb58c909fd80cc8ce053b5f1b6565bd28a416d2.tar.gz meson-2bb58c909fd80cc8ce053b5f1b6565bd28a416d2.tar.bz2 |
Use CompilerArgs for generation of compile commands
At the same time, also fix the order in which compile arguments are
added. Detailed comments have been added concerning the priority and
order of the arguments.
Also adds a unit test and an integration test for the same.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index a9f08c3..e5d2284 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -585,14 +585,16 @@ class BuildTarget(Target): for i in self.link_depends: if not isinstance(i, str): raise InvalidArguments('Link_depends arguments must be strings.') - inclist = kwargs.get('include_directories', []) - if not isinstance(inclist, list): - inclist = [inclist] - self.add_include_dirs(inclist) deplist = kwargs.get('dependencies', []) if not isinstance(deplist, list): deplist = [deplist] self.add_deps(deplist) + # Target-specific include dirs must be added after include dirs from + # internal deps (added inside self.add_deps()) to override correctly. + inclist = kwargs.get('include_directories', []) + if not isinstance(inclist, list): + inclist = [inclist] + self.add_include_dirs(inclist) self.custom_install_dir = kwargs.get('install_dir', None) if self.custom_install_dir is not None: if not isinstance(self.custom_install_dir, str): |