From 71b8263e65f1bf10c8cafb2e9bf1836b773ac04b Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 6 Apr 2016 11:20:33 -0400 Subject: [PATCH] add a configuration option to build without test application --- wscript | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index 02f927e..617db58 100644 --- a/wscript +++ b/wscript @@ -1,5 +1,10 @@ def options(opt): opt.load("compiler_c compiler_cxx") + opt.add_option("--without-tests", + action = "store_true", + dest = "without_tests", + default = False, + help = "Do not build test application") def configure(conf): conf.load("compiler_c compiler_cxx") @@ -9,15 +14,18 @@ def configure(conf): conf.env.DEFINES += ['''GLCXX_GL_INCLUDE="GL3/gl3w.h"'''] conf.env.CXXFLAGS += ["-Wall"] conf.env.CXXFLAGS += ["-std=gnu++11"] - conf.check_cfg(package = "sdl2", args = "--cflags --libs") + conf.env.WITHOUT_TESTS = conf.options.without_tests + if not conf.options.without_tests: + conf.check_cfg(package = "sdl2", args = "--cflags --libs") def build(bld): sources = bld.path.ant_glob("src/**/*.cpp") bld.shlib(source = sources, target = "glcxx") - test_sources = bld.path.ant_glob("test/**/*.cpp") + \ - bld.path.ant_glob("test/**/*.c") - bld.program(source = test_sources, + if not bld.env.WITHOUT_TESTS: + test_sources = bld.path.ant_glob("test/**/*.cpp") + \ + bld.path.ant_glob("test/**/*.c") + bld.program(source = test_sources, target = "glcxx-test", use = "glcxx", uselib = "SDL2",