[gnome-builder] meson: Extract -include flags from compile flags
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: Extract -include flags from compile flags
- Date: Fri, 4 Aug 2017 21:49:06 +0000 (UTC)
commit 271ef4e9d263bed8a62e0eb24c766e85c4c9a08a
Author: Patrick Griffis <tingping tingping se>
Date: Fri Aug 4 17:48:24 2017 -0400
meson: Extract -include flags from compile flags
plugins/meson/meson_plugin/__init__.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/meson/meson_plugin/__init__.py b/plugins/meson/meson_plugin/__init__.py
index 352b0f1..6952cc7 100644
--- a/plugins/meson/meson_plugin/__init__.py
+++ b/plugins/meson/meson_plugin/__init__.py
@@ -47,13 +47,15 @@ def execInRuntime(runtime, *args, **kwargs):
def extract_flags(command: str, builddir: str):
flags = GLib.shell_parse_argv(command)[1] # Raises on failure
wanted_flags = []
- for flag in flags:
+ for i, flag in enumerate(flags):
if flag.startswith('-I'):
# All paths are relative to build
abspath = path.normpath(path.join(builddir, flag[2:]))
wanted_flags.append('-I' + abspath)
elif flag.startswith(('-isystem', '-W', '-D', '-std')):
wanted_flags.append(flag)
+ elif flag == '-include':
+ wanted_flags += [flag, flags[i + 1]]
return wanted_flags
class MesonBuildSystem(Ide.Object, Ide.BuildSystem, Gio.AsyncInitable):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]