diff options
author | Andrew Anderson <aanderso@tcd.ie> | 2017-05-18 13:50:38 +0100 |
---|---|---|
committer | Andrew Anderson <aanderso@tcd.ie> | 2017-05-22 17:04:02 +0100 |
commit | d619a8ae4dda4442b7fd60742516595bd5d24f20 (patch) | |
tree | cf69d4a9fde74ac9b7dba4e868e1368d5f480f62 | |
parent | 46d5927c3461ec270de8b0fc087ac5dc2431488f (diff) | |
download | armcl-d619a8ae4dda4442b7fd60742516595bd5d24f20.tar.gz armcl-d619a8ae4dda4442b7fd60742516595bd5d24f20.tar.bz2 armcl-d619a8ae4dda4442b7fd60742516595bd5d24f20.zip |
Add a build parameter controlling whether or not to build the example programs, default to off
-rw-r--r-- | SConstruct | 1 | ||||
-rw-r--r-- | sconscript | 50 |
2 files changed, 27 insertions, 24 deletions
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') |