aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-09-11 19:04:05 +0300
committerGitHub <noreply@github.com>2017-09-11 19:04:05 +0300
commit77bf63d6638cdb3f659cc97179e27d96a85c25a6 (patch)
treea81e76e825b9af4094a5377fceebde8913c00657 /mesonbuild/backend/ninjabackend.py
parent27554e9eb13c00efcc1427e9d895809365cdc9bf (diff)
parentdb199b06e65ddb1dc3cb674cad31d872b60aee56 (diff)
downloadmeson-77bf63d6638cdb3f659cc97179e27d96a85c25a6.zip
meson-77bf63d6638cdb3f659cc97179e27d96a85c25a6.tar.gz
meson-77bf63d6638cdb3f659cc97179e27d96a85c25a6.tar.bz2
Merge pull request #2291 from centricular/fix-custom-target-includes-ordering
backends: Add custom target inc dirs before target inc dirs
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index dce3b80..bff173a 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2038,6 +2038,12 @@ rule FORTRAN_DEP_HACK
# Add compiler args and include paths from several sources; defaults,
# build options, external dependencies, etc.
commands += self.generate_basic_compiler_args(target, compiler, no_warn_args)
+ # Add custom target dirs as includes automatically, but before
+ # target-specific include directories.
+ # XXX: Not sure if anyone actually uses this? It can cause problems in
+ # situations which increase the likelihood for a header name collision,
+ # such as in subprojects.
+ commands += self.get_custom_target_dir_include_args(target, compiler)
# Add include dirs from the `include_directories:` kwarg on the target
# and from `include_directories:` of internal deps of the target.
#
@@ -2081,14 +2087,12 @@ rule FORTRAN_DEP_HACK
# from external dependencies, internal dependencies, and from
# per-target `include_directories:`
#
- # We prefer headers in the build dir and the custom target dir over the
- # source dir since, for instance, the user might have an
- # srcdir == builddir Autotools build in their source tree. Many
- # projects that are moving to Meson have both Meson and Autotools in
- # parallel as part of the transition.
+ # We prefer headers in the build dir over the source dir since, for
+ # instance, the user might have an srcdir == builddir Autotools build
+ # in their source tree. Many projects that are moving to Meson have
+ # both Meson and Autotools in parallel as part of the transition.
if target.implicit_include_directories:
commands += self.get_source_dir_include_args(target, compiler)
- commands += self.get_custom_target_dir_include_args(target, compiler)
if target.implicit_include_directories:
commands += self.get_build_dir_include_args(target, compiler)
# Finally add the private dir for the target to the include path. This