conf.env.TARGET_WINDOWS = conf.options.target_windows
conf.env.STATIC_OPENJPEG = conf.options.static_openjpeg
conf.env.STATIC_LIBDCP = conf.options.static_libdcp
+ conf.env.ENABLE_DEBUG = conf.options.enable_debug
if conf.options.target_windows:
conf.env.append_value('CXXFLAGS', '-DLIBDCP_WINDOWS')
conf.recurse('asdcplib')
def build(bld):
- create_version_cc(VERSION)
+ create_version_cc(bld, VERSION)
if bld.env.TARGET_WINDOWS:
boost_lib_suffix = '-mt'
def dist(ctx):
ctx.excl = 'TODO core *~ .git build .waf* .lock* doc/*~ src/*~ test/ref/*~ __pycache__'
-def create_version_cc(version):
+def create_version_cc(bld, version):
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()
text = '#include "version.h"\n'
text += 'char const * libdcp::git_commit = \"%s\";\n' % commit
text += 'char const * libdcp::version = \"%s\";\n' % version
+ if bld.env.ENABLE_DEBUG:
+ debug_string = 'true'
+ else:
+ debug_string = 'false'
+ text += 'bool const built_with_debug = %s;\n' % debug_string
print('Writing version information to src/version.cc')
o = open('src/version.cc', 'w')
o.write(text)