diff options
Diffstat (limited to 'examples/SConscript')
-rw-r--r-- | examples/SConscript | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/examples/SConscript b/examples/SConscript index 748f771ec..853a1bb51 100644 --- a/examples/SConscript +++ b/examples/SConscript @@ -23,8 +23,6 @@ import SCons import os.path Import('env') -Import('arm_compute_a') -Import('arm_compute_so') if env['opencl']: Import('opencl') @@ -38,17 +36,33 @@ examples_env.Append(LIBPATH = ["#build/%s/opencl-1.2-stubs" % env['build_dir']]) # Build examples utils = examples_env.Object("../utils/Utils.cpp") -if env['os'] in ['android', 'bare_metal']: +if env['os'] in ['android', 'bare_metal'] or env['standalone']: + Import('arm_compute_a') arm_compute_lib = arm_compute_a arm_compute_dependency = arm_compute_a else: + Import('arm_compute_so') arm_compute_lib = "arm_compute" arm_compute_dependency = arm_compute_so if env['opencl'] and env['neon']: for file in Glob("./neoncl_*.cpp"): example = os.path.basename(os.path.splitext(str(file))[0]) - prog = examples_env.Program(example, ["{}.cpp".format(example), utils], LIBS = [arm_compute_lib, "OpenCL"]) + prog = examples_env.Program(example, ["{}.cpp".format(example), utils], CPPDEFINES=['ARM_COMPUTE_CL'], LIBS = [arm_compute_lib, "OpenCL"]) + Depends(prog, [arm_compute_dependency, opencl]) + alias = examples_env.Alias(example, prog) + Default(alias) + Import('arm_compute_graph_a') + Import('arm_compute_graph_so') + if env['os'] == 'android': + arm_compute_graph_lib = arm_compute_graph_a + else: + arm_compute_graph_lib = "arm_compute_graph" + + graph_utils = examples_env.Object("../utils/GraphUtils.cpp") + for file in Glob("./graph_*.cpp"): + example = os.path.basename(os.path.splitext(str(file))[0]) + prog = examples_env.Program(example, ["{}.cpp".format(example), utils, graph_utils], CPPDEFINES=['ARM_COMPUTE_CL'], LIBS = [arm_compute_graph_lib, "OpenCL"]) Depends(prog, [arm_compute_dependency, opencl]) alias = examples_env.Alias(example, prog) Default(alias) @@ -56,7 +70,7 @@ if env['opencl'] and env['neon']: if env['opencl']: for file in Glob("./cl_*.cpp"): example = os.path.basename(os.path.splitext(str(file))[0]) - prog = examples_env.Program(example, ["{}.cpp".format(example), utils], LIBS = [arm_compute_lib, "OpenCL"]) + prog = examples_env.Program(example, ["{}.cpp".format(example), utils], CPPDEFINES=['ARM_COMPUTE_CL'], LIBS = [arm_compute_lib, "OpenCL"]) Depends(prog, [arm_compute_dependency, opencl]) alias = examples_env.Alias(example, prog) Default(alias) |