From: Andrew Anderson Date: Thu, 18 May 2017 12:50:38 +0000 (+0100) Subject: Add a build parameter controlling whether or not to build the example programs, defau... X-Git-Tag: submit/tizen/20180223.063230~14^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d619a8ae4dda4442b7fd60742516595bd5d24f20;p=platform%2Fupstream%2Farmcl.git Add a build parameter controlling whether or not to build the example programs, default to off --- diff --git a/SConstruct b/SConstruct index 693ad68a3..862eec71e 100644 --- a/SConstruct +++ b/SConstruct @@ -29,6 +29,7 @@ vars.AddVariables( EnumVariable("arch", "Target Architecture", "armv7a", allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "x86_32", "x86_64")), EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "bare_metal")), EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile")), + BoolVariable("examples", "Build example programs", False), BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True), BoolVariable("opencl", "Enable OpenCL support", True), BoolVariable("neon", "Enable Neon support", False), diff --git a/sconscript b/sconscript index 6ec52f6f5..d3e71cda1 100644 --- a/sconscript +++ b/sconscript @@ -351,30 +351,32 @@ alias = env.Alias("arm_compute",objects) Default(alias) # Build examples -test_helpers = env.Object("test_helpers/Utils.cpp") -if env['opencl'] and env['neon']: - for file in Glob("examples/neoncl_*.cpp"): - example = os.path.basename( os.path.splitext(str(file))[0]) - prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs+['OpenCL']) - alias = env.Alias(example, prog) - Depends(prog, objects) - Default( alias ) - -if env['opencl']: - for file in Glob("examples/cl_*.cpp"): - example = os.path.basename( os.path.splitext(str(file))[0]) - prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs+['OpenCL']) - alias = env.Alias(example, prog) - Depends(prog, objects) - Default( alias ) - -if env['neon']: - for file in Glob("examples/neon_*.cpp"): - example = os.path.basename( os.path.splitext(str(file))[0]) - prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs) - alias = env.Alias(example, prog) - Depends(prog, objects) - Default( alias ) +if env['examples']: + test_helpers = env.Object("test_helpers/Utils.cpp") + + if env['opencl'] and env['neon']: + for file in Glob("examples/neoncl_*.cpp"): + example = os.path.basename( os.path.splitext(str(file))[0]) + prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs+['OpenCL']) + alias = env.Alias(example, prog) + Depends(prog, objects) + Default( alias ) + + if env['opencl']: + for file in Glob("examples/cl_*.cpp"): + example = os.path.basename( os.path.splitext(str(file))[0]) + prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs+['OpenCL']) + alias = env.Alias(example, prog) + Depends(prog, objects) + Default( alias ) + + if env['neon']: + for file in Glob("examples/neon_*.cpp"): + example = os.path.basename( os.path.splitext(str(file))[0]) + prog = env.Program(example, ['examples/%s.cpp' % example, test_helpers], LIBS=example_libs) + alias = env.Alias(example, prog) + Depends(prog, objects) + Default( alias ) Export('env')