diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-06-21 01:52:46 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-06-21 01:53:26 +0530 |
commit | 50fef8921804d3189efb26b26e4e1b4afa3012ec (patch) | |
tree | 3661826a3c39fc03b83cc30b864129de22d669e7 | |
parent | 06ce41b5259e2d9e16cfc1e900f0e4bc44f37e8f (diff) | |
download | meson-50fef8921804d3189efb26b26e4e1b4afa3012ec.zip meson-50fef8921804d3189efb26b26e4e1b4afa3012ec.tar.gz meson-50fef8921804d3189efb26b26e4e1b4afa3012ec.tar.bz2 |
ninjabackend: Add subdir includes before external dep includes
Fixes https://github.com/mesonbuild/meson/issues/604
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index eb2579d..6ec5e3d 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1422,21 +1422,21 @@ rule FORTRAN_DEP_HACK commands = [] # The first thing is implicit include directories: source, build and private. commands += compiler.get_include_args(self.get_target_private_dir(target), False) + # Compiler args for compiling this target commands += compilers.get_base_compile_args(self.environment.coredata.base_options, compiler) + # Add the root source and build directories as include dirs curdir = target.get_subdir() tmppath = os.path.normpath(os.path.join(self.build_to_src, curdir)) commands += compiler.get_include_args(tmppath, False) if curdir == '': curdir = '.' commands += compiler.get_include_args(curdir, False) - commands += self.generate_basic_compiler_args(target, compiler) - # -I args work differently than other ones. In them the - # first found directory is used whereas for other flags - # (such as -ffoo -fno-foo) the latest one is used. - # Therefore put the internal include directories here - # at the beginning so they override args coming from - # e.g. pkg-config. + # -I args work differently than other ones. In them the first found + # directory is used whereas for other flags (such as -ffoo -fno-foo) the + # latest one is used. Therefore put the internal include directories + # here before generating the "basic compiler args" so they override args + # coming from e.g. pkg-config. for i in target.get_include_dirs(): basedir = i.get_curdir() for d in i.get_incdirs(): @@ -1448,6 +1448,7 @@ rule FORTRAN_DEP_HACK commands += sargs for d in i.get_extra_build_dirs(): commands += compiler.get_include_args(d, i.is_system) + commands += self.generate_basic_compiler_args(target, compiler) for d in target.external_deps: if d.need_threads(): commands += compiler.thread_flags() |