aboutsummaryrefslogtreecommitdiff
path: root/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-06-07 23:39:59 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-06-07 23:43:16 +0300
commit365f529c75a6b55278db2ee5749d26a29a56fa83 (patch)
tree777f5a526a9f5753c912bcd73a1204715eab3698 /environment.py
parentf88779319d61e316bef8e5b3f9241cf2d80b3e6d (diff)
downloadmeson-365f529c75a6b55278db2ee5749d26a29a56fa83.zip
meson-365f529c75a6b55278db2ee5749d26a29a56fa83.tar.gz
meson-365f529c75a6b55278db2ee5749d26a29a56fa83.tar.bz2
Store build flags into coredata as it is persistent and needs to survive over Meson reconfigurations.
Diffstat (limited to 'environment.py')
-rw-r--r--environment.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/environment.py b/environment.py
index 15ff7da..e335895 100644
--- a/environment.py
+++ b/environment.py
@@ -1449,6 +1449,20 @@ def get_library_dirs():
unixdirs.append('/usr/local/lib')
return unixdirs
+def get_flags_from_envvars(lang):
+ if lang == 'c':
+ compile_flags = os.environ.get('CFLAGS', '').split()
+ compile_flags += os.environ.get('CPPFLAGS', '').split()
+ link_flags = compile_flags + os.environ.get('LDFLAGS', '').split()
+ elif lang == 'cpp':
+ compile_flags = os.environ.get('CXXFLAGS', '').split()
+ compile_flags += os.environ.get('CPPFLAGS', '').split()
+ link_flags = compile_flags + os.environ.get('LDFLAGS', '').split()
+ else:
+ compile_flags = []
+ link_flags = []
+ return (compile_flags, link_flags)
+
class CrossBuildInfo():
def __init__(self, filename):
self.items = {}