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/windows.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/windows.py')
-rw-r--r-- | mesonbuild/modules/windows.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 8203789..c233d90 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -14,6 +14,7 @@ import os +from .. import mlog from .. import mesonlib, dependencies, build from ..mesonlib import MesonException from . import get_include_args @@ -38,13 +39,18 @@ class WindowsModule(ExtensionModule): for incd in inc_dirs: if not isinstance(incd.held_object, (str, build.IncludeDirs)): raise MesonException('Resource include dirs should be include_directories().') - extra_args += get_include_args(state.environment, inc_dirs) + extra_args += get_include_args(inc_dirs) if comp.id == 'msvc': rescomp = dependencies.ExternalProgram('rc', silent=True) res_args = extra_args + ['/nologo', '/fo@OUTPUT@', '@INPUT@'] suffix = 'res' else: + m = 'Argument {!r} has a space which may not work with windres due to ' \ + 'a MinGW bug: https://sourceware.org/bugzilla/show_bug.cgi?id=4933' + for arg in extra_args: + if ' ' in arg: + mlog.warning(m.format(arg)) # Pick-up env var WINDRES if set. This is often used for specifying # an arch-specific windres. rescomp_name = os.environ.get('WINDRES', 'windres') |