diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-28 14:31:45 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-28 14:49:32 +0530 |
commit | 976c9abcd0348ffb29863ac2688c661eda524a47 (patch) | |
tree | 968913d082a1ce8ab8202aee71a9d15ba5f4688d /mesonbuild/modules/__init__.py | |
parent | 03d0feec7ceed1a1ee2e6284a86dbc26a088440f (diff) | |
download | meson-976c9abcd0348ffb29863ac2688c661eda524a47.zip meson-976c9abcd0348ffb29863ac2688c661eda524a47.tar.gz meson-976c9abcd0348ffb29863ac2688c661eda524a47.tar.bz2 |
modules: Start using @SOURCE_ROOT@ and @BUILD_ROOT@
First step in fixing https://github.com/mesonbuild/meson/issues/1419
Also works around an issue in the MinGW windres.exe that causes it to
fail if any of the arguments passed to it contain a space. There seems
to be no way to quote or escape the spaces in the path to make windres
parse the path correctly, so we just warn about it instead.
https://sourceware.org/bugzilla/show_bug.cgi?id=4933
https://github.com/mesonbuild/meson/pull/1346
Diffstat (limited to 'mesonbuild/modules/__init__.py')
-rw-r--r-- | mesonbuild/modules/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index c7f24d4..fde3b91 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -24,7 +24,11 @@ def find_program(program_name, target_name): return program -def get_include_args(environment, include_dirs, prefix='-I'): +def get_include_args(include_dirs, prefix='-I'): + ''' + Expand include arguments to refer to the source and build dirs + by using @SOURCE_ROOT@ and @BUILD_ROOT@ for later substitution + ''' if not include_dirs: return [] @@ -43,8 +47,8 @@ def get_include_args(environment, include_dirs, prefix='-I'): basedir = dirs.get_curdir() for d in dirs.get_incdirs(): expdir = os.path.join(basedir, d) - srctreedir = os.path.join(environment.get_source_dir(), expdir) - buildtreedir = os.path.join(environment.get_build_dir(), expdir) + srctreedir = os.path.join('@SOURCE_ROOT@', expdir) + buildtreedir = os.path.join('@BUILD_ROOT@', expdir) dirs_str += ['%s%s' % (prefix, buildtreedir), '%s%s' % (prefix, srctreedir)] for d in dirs.get_extra_build_dirs(): |