diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-03 16:33:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-03 16:33:28 +0100 |
| commit | b68591911bd8116df0ad987627244b9bdf87de89 (patch) | |
| tree | 43aa12a69b5023af81ddf95173a65870e1e2144a /wscript | |
| parent | 6057976df6cce189567012d5b1bc5533a532813b (diff) | |
Make C++ flags available from makedcp.
Diffstat (limited to 'wscript')
| -rw-r--r-- | wscript | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -206,7 +206,7 @@ def configure(conf): conf.recurse('test') def build(bld): - create_version_cc(VERSION) + create_version_cc(VERSION, bld.env.CXXFLAGS) bld.recurse('src') bld.recurse('test') @@ -232,7 +232,7 @@ def dist(ctx): GRSYMS GRTAGS GSYMS GTAGS """ -def create_version_cc(version): +def create_version_cc(version, cxx_flags): if os.path.exists('.git'): cmd = "LANG= git log --abbrev HEAD^..HEAD ." output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() @@ -245,6 +245,13 @@ def create_version_cc(version): text = '#include "version.h"\n' text += 'char const * dvdomatic_git_commit = \"%s\";\n' % commit text += 'char const * dvdomatic_version = \"%s\";\n' % version + + t = '' + for f in cxx_flags: + f = f.replace('"', '\\"') + t += f + ' ' + text += 'char const * dvdomatic_cxx_flags = \"%s\";\n' % t[:-1] + print('Writing version information to src/lib/version.cc') o = open('src/lib/version.cc', 'w') o.write(text) |
