diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-11-30 16:30:43 +0000 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-12-03 13:47:53 +0000 |
commit | 323ce0f0b06bca785959913e75e1f51d383c351a (patch) | |
tree | dc3729e19a43d8290285987c51d9799581412c33 /SConstruct | |
parent | 08a4517905da959b6e3401cc24f5e2018f9b51ac (diff) | |
download | ComputeLibrary-323ce0f0b06bca785959913e75e1f51d383c351a.tar.gz |
COMPMID-1819 Add option to build library with -fno-exceptions
Change-Id: I3de6bb33746d52f8d8c337ab7776eccee8c205fb
Reviewed-on: https://review.mlplatform.org/328
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index 11fbd8b357..49b1d1765c 100644 --- a/SConstruct +++ b/SConstruct @@ -55,6 +55,7 @@ vars.AddVariables( BoolVariable("cppthreads", "Enable C++11 threads backend", True), PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept), PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept), + BoolVariable("exceptions", "Enable/disable C++ exception support", True), #FIXME Remove before release (And remove all references to INTERNAL_ONLY) BoolVariable("internal_only", "Enable ARM internal only tests", False), ("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""), @@ -118,6 +119,14 @@ if env['os'] == 'bare_metal': print("ERROR: OpenMP and C++11 threads not supported in bare_metal. Use cppthreads=0 openmp=0") Exit(1) +if not env['exceptions']: + if env['opencl'] or env['gles_compute']: + print("ERROR: OpenCL and GLES are not supported when building without exceptions. Use opencl=0 gles_compute=0") + Exit(1) + + env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED']) + env.Append(CXXFLAGS = ['-fno-exceptions']) + env.Append(CXXFLAGS = ['-Wno-deprecated-declarations','-Wall','-DARCH_ARM', '-Wextra','-Wno-unused-parameter','-pedantic','-Wdisabled-optimization','-Wformat=2', '-Winit-self','-Wstrict-overflow=2','-Wswitch-default', @@ -297,8 +306,8 @@ if env['gles_compute'] and env['os'] != 'android': SConscript('./SConscript', variant_dir=build_path, duplicate=0) -if env['examples'] and env['os'] != 'bare_metal': +if env['examples'] and env['os'] != 'bare_metal' and env['exceptions']: SConscript('./examples/SConscript', variant_dir='%s/examples' % build_path, duplicate=0) -if env['os'] != 'bare_metal': +if env['os'] != 'bare_metal' and env['exceptions']: SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0) |