diff options
author | Anthony Barbier <Anthony.barbier@arm.com> | 2017-05-23 11:36:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-23 11:36:01 +0100 |
commit | 664d833b9d7b569db60b0f6d93e80f91f2c07c39 (patch) | |
tree | cf69d4a9fde74ac9b7dba4e868e1368d5f480f62 | |
parent | 46d5927c3461ec270de8b0fc087ac5dc2431488f (diff) | |
parent | d619a8ae4dda4442b7fd60742516595bd5d24f20 (diff) | |
download | armcl-664d833b9d7b569db60b0f6d93e80f91f2c07c39.tar.gz armcl-664d833b9d7b569db60b0f6d93e80f91f2c07c39.tar.bz2 armcl-664d833b9d7b569db60b0f6d93e80f91f2c07c39.zip |
Merge pull request #114 from andrew-wja/master
Add a build flag to control whether or not the example programs get built
-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') |