Browse Source

Add C++ header compile test

zrythm_meson
David Robillard 3 years ago
parent
commit
9bb8789951
  1. 30
      wscript

30
wscript

@ -47,6 +47,7 @@ spec_map = { @@ -47,6 +47,7 @@ spec_map = {
def options(ctx):
ctx.load('compiler_c')
ctx.load('compiler_cxx')
ctx.load('lv2')
ctx.add_flags(
ctx.configuration_options(),
@ -63,6 +64,11 @@ def configure(conf): @@ -63,6 +64,11 @@ def configure(conf):
Options.options.build_tests = False
Options.options.no_plugins = True
try:
conf.load('compiler_cxx', cache=True)
except Exception:
pass
if Options.options.online_docs:
Options.options.docs = True
@ -401,13 +407,12 @@ def build(bld): @@ -401,13 +407,12 @@ def build(bld):
bld.add_post_fun(check_links)
if bld.env.BUILD_TESTS:
# Generate a compile test .c file that includes all headers
# Generate a compile test file that includes all headers
def gen_build_test(task):
out = open(task.outputs[0].abspath(), 'w')
for i in task.inputs:
out.write('#include "%s"\n' % i.bldpath())
out.write('int main(void) { return 0; }\n')
out.close()
with open(task.outputs[0].abspath(), 'w') as out:
for i in task.inputs:
out.write('#include "%s"\n' % i.bldpath())
out.write('int main(void) { return 0; }\n')
bld(rule = gen_build_test,
source = bld.path.ant_glob('lv2/**/*.h'),
@ -421,6 +426,19 @@ def build(bld): @@ -421,6 +426,19 @@ def build(bld):
uselib = 'LV2',
install_path = None)
if 'COMPILER_CXX' in bld.env:
bld(rule = gen_build_test,
source = bld.path.ant_glob('lv2/**/*.h'),
target = 'build-test.cpp',
install_path = None)
bld(features = 'cxx cxxprogram',
source = bld.path.get_bld().make_node('build-test.cpp'),
target = 'build-test-cpp',
includes = '.',
uselib = 'LV2',
install_path = None)
if bld.env.BUILD_BOOK:
# Build "Programming LV2 Plugins" book from plugin examples
bld.recurse('plugins')

Loading…
Cancel
Save