[gnome-builder] meson: Ensure all build flags are absolute paths
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] meson: Ensure all build flags are absolute paths
- Date: Tue, 20 Dec 2016 10:05:27 +0000 (UTC)
commit 182e05c57a3cbf3f3c93505f78c3f6109351772a
Author: Patrick Griffis <tingping tingping se>
Date: Tue Dec 20 05:05:03 2016 -0500
meson: Ensure all build flags are absolute paths
plugins/meson/meson_plugin/__init__.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/meson/meson_plugin/__init__.py b/plugins/meson/meson_plugin/__init__.py
index d9da351..8068ee9 100644
--- a/plugins/meson/meson_plugin/__init__.py
+++ b/plugins/meson/meson_plugin/__init__.py
@@ -167,7 +167,16 @@ class MesonBuilder(Ide.Builder):
def extract_flags(command: str):
flags = GLib.shell_parse_argv(command)[1] # Raises on failure
- return [flag for flag in flags if flag.startswith(('-I', '-isystem', '-W', '-D'))]
+ build_dir = self._get_build_dir().get_path()
+ wanted_flags = []
+ for flag in flags:
+ if flag.startswith('-I'):
+ # All paths are relative to build
+ abspath = path.normpath(path.join(build_dir, flag[2:]))
+ wanted_flags.append('-I' + abspath)
+ elif flag.startswith(('-isystem', '-W', '-D')):
+ wanted_flags.append(flag)
+ return wanted_flags
def build_flags_thread():
commands_file = path.join(self._get_build_dir().get_path(), 'compile_commands.json')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]