blob: a0f652093930a9c8200be2e05802e85b32a31c35 [file] [log] [blame]
Anthony Barbier871448e2017-03-24 14:54:29 +00001# Copyright (c) 2016, 2017 ARM Limited.
2#
3# SPDX-License-Identifier: MIT
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to
7# deal in the Software without restriction, including without limitation the
8# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9# sell copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in all
13# copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22
Anthony Barbierdbdab852017-06-23 15:42:00 +010023import SCons
Anthony Barbier46d59272017-05-04 09:15:15 +010024import os
Anthony Barbierdbdab852017-06-23 15:42:00 +010025import subprocess
26
27def version_at_least(version, required):
28 end = min(len(version), len(required))
29
30 for i in range(0, end, 2):
31 if int(version[i]) < int(required[i]):
32 return False
33 elif int(version[i]) > int(required[i]):
34 return True
35
36 return True
Anthony Barbier46d59272017-05-04 09:15:15 +010037
38vars = Variables("scons")
39vars.AddVariables(
40 BoolVariable("debug", "Debug", False),
41 BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False),
Anthony Barbier8140e1e2017-12-14 23:48:46 +000042 BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False),
Jenkins36ccc902020-02-21 11:10:48 +000043 EnumVariable("arch", "Target Architecture", "armv7a",
44 allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "x86_32", "x86_64",
45 "armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "x86")),
46 EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")),
Jenkins6a7771e2020-05-28 11:28:36 +010047 EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "bare_metal")),
Anthony Barbier06ea0482018-02-22 15:45:35 +000048 EnumVariable("build", "Build type", "cross_compile", allowed_values=("native", "cross_compile", "embed_only")),
Anthony Barbierdbdab852017-06-23 15:42:00 +010049 BoolVariable("examples", "Build example programs", True),
Jenkins0e205f72019-11-28 16:53:35 +000050 BoolVariable("gemm_tuner", "Build gemm_tuner programs", True),
Anthony Barbier46d59272017-05-04 09:15:15 +010051 BoolVariable("Werror", "Enable/disable the -Werror compilation flag", True),
Kaizen8938bd32017-09-28 14:38:23 +010052 BoolVariable("standalone", "Builds the tests as standalone executables, links statically with libgcc, libstdc++ and libarm_compute", False),
Anthony Barbier46d59272017-05-04 09:15:15 +010053 BoolVariable("opencl", "Enable OpenCL support", True),
54 BoolVariable("neon", "Enable Neon support", False),
Anthony Barbier8140e1e2017-12-14 23:48:46 +000055 BoolVariable("gles_compute", "Enable OpenGL ES Compute Shader support", False),
Anthony Barbierf45d5a92018-01-24 16:23:15 +000056 BoolVariable("embed_kernels", "Embed OpenCL kernels and OpenGL ES compute shaders in library binary", True),
Anthony Barbier46d59272017-05-04 09:15:15 +010057 BoolVariable("set_soname", "Set the library's soname and shlibversion (requires SCons 2.4 or above)", False),
Jenkins6a7771e2020-05-28 11:28:36 +010058 BoolVariable("tracing", "Enable runtime tracing", False),
Anthony Barbier46d59272017-05-04 09:15:15 +010059 BoolVariable("openmp", "Enable OpenMP backend", False),
60 BoolVariable("cppthreads", "Enable C++11 threads backend", True),
Anthony Barbierdbdab852017-06-23 15:42:00 +010061 PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
Jenkinsb9abeae2018-11-22 11:58:08 +000062 PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept),
Jenkins514be652019-02-28 12:25:18 +000063 BoolVariable("exceptions", "Enable/disable C++ exception support", True),
Jenkins36ccc902020-02-21 11:10:48 +000064 PathVariable("linker_script", "Use an external linker script", "", PathVariable.PathAccept),
Jenkins514be652019-02-28 12:25:18 +000065 ("toolchain_prefix", "Override the toolchain prefix", ""),
Jenkins36ccc902020-02-21 11:10:48 +000066 ("compiler_prefix", "Override the compiler prefix", ""),
Jenkinsb3a371b2018-05-23 11:36:53 +010067 ("extra_cxx_flags", "Extra CXX flags to be appended to the build command", ""),
Jenkinsb9abeae2018-11-22 11:58:08 +000068 ("extra_link_flags", "Extra LD flags to be appended to the build command", ""),
Jenkinsb3a371b2018-05-23 11:36:53 +010069 ("compiler_cache", "Command to prefix to the C and C++ compiler (e.g ccache)", "")
Anthony Barbier46d59272017-05-04 09:15:15 +010070)
71
Anthony Barbierdbdab852017-06-23 15:42:00 +010072env = Environment(platform="posix", variables=vars, ENV = os.environ)
Jenkinsb9abeae2018-11-22 11:58:08 +000073build_path = env['build_dir']
74# If build_dir is a relative path then add a #build/ prefix:
75if not env['build_dir'].startswith('/'):
76 SConsignFile('build/%s/.scons' % build_path)
77 build_path = "#build/%s" % build_path
78else:
79 SConsignFile('%s/.scons' % build_path)
80
81install_path = env['install_dir']
82#If the install_dir is a relative path then assume it's from inside build_dir
83if not env['install_dir'].startswith('/') and install_path != "":
84 install_path = "%s/%s" % (build_path, install_path)
85
86env.Append(LIBPATH = [build_path])
Anthony Barbier06ea0482018-02-22 15:45:35 +000087Export('env')
88Export('vars')
Anthony Barbierdbdab852017-06-23 15:42:00 +010089
Jenkinsb9abeae2018-11-22 11:58:08 +000090def install_lib( lib ):
91 # If there is no install folder, then there is nothing to do:
92 if install_path == "":
93 return lib
94 return env.Install( "%s/lib/" % install_path, lib)
95def install_bin( bin ):
96 # If there is no install folder, then there is nothing to do:
97 if install_path == "":
98 return bin
99 return env.Install( "%s/bin/" % install_path, bin)
100def install_include( inc ):
101 if install_path == "":
102 return inc
103 return env.Install( "%s/include/" % install_path, inc)
104
105Export('install_lib')
106Export('install_bin')
Anthony Barbier46d59272017-05-04 09:15:15 +0100107
108Help(vars.GenerateHelpText(env))
109
Jenkins36ccc902020-02-21 11:10:48 +0000110if env['linker_script'] and env['os'] != 'bare_metal':
111 print("Linker script is only supported for bare_metal builds")
112 Exit(1)
113
Anthony Barbier06ea0482018-02-22 15:45:35 +0000114if env['build'] == "embed_only":
Jenkinsb9abeae2018-11-22 11:58:08 +0000115 SConscript('./SConscript', variant_dir=build_path, duplicate=0)
Anthony Barbier06ea0482018-02-22 15:45:35 +0000116 Return()
117
Anthony Barbierdbdab852017-06-23 15:42:00 +0100118if env['neon'] and 'x86' in env['arch']:
ggardete2542c92018-06-29 17:01:01 +0200119 print("Cannot compile NEON for x86")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100120 Exit(1)
121
122if env['set_soname'] and not version_at_least(SCons.__version__, "2.4"):
ggardete2542c92018-06-29 17:01:01 +0200123 print("Setting the library's SONAME / SHLIBVERSION requires SCons 2.4 or above")
124 print("Update your version of SCons or use set_soname=0")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100125 Exit(1)
126
127if env['os'] == 'bare_metal':
128 if env['cppthreads'] or env['openmp']:
129 print("ERROR: OpenMP and C++11 threads not supported in bare_metal. Use cppthreads=0 openmp=0")
130 Exit(1)
131
Jenkins514be652019-02-28 12:25:18 +0000132if not env['exceptions']:
133 if env['opencl'] or env['gles_compute']:
134 print("ERROR: OpenCL and GLES are not supported when building without exceptions. Use opencl=0 gles_compute=0")
135 Exit(1)
136
137 env.Append(CPPDEFINES = ['ARM_COMPUTE_EXCEPTIONS_DISABLED'])
138 env.Append(CXXFLAGS = ['-fno-exceptions'])
139
Jenkins0e205f72019-11-28 16:53:35 +0000140env.Append(CXXFLAGS = ['-Wall','-DARCH_ARM',
141 '-Wextra','-pedantic','-Wdisabled-optimization','-Wformat=2',
Anthony Barbierdbdab852017-06-23 15:42:00 +0100142 '-Winit-self','-Wstrict-overflow=2','-Wswitch-default',
Jenkins36ccc902020-02-21 11:10:48 +0000143 '-std=gnu++11','-Woverloaded-virtual', '-Wformat-security',
Jenkins0e205f72019-11-28 16:53:35 +0000144 '-Wctor-dtor-privacy','-Wsign-promo','-Weffc++','-Wno-overlength-strings'])
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000145
Anthony Barbierdbdab852017-06-23 15:42:00 +0100146env.Append(CPPDEFINES = ['_GLIBCXX_USE_NANOSLEEP'])
147
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000148default_cpp_compiler = 'g++' if env['os'] != 'android' else 'clang++'
149default_c_compiler = 'gcc' if env['os'] != 'android' else 'clang'
150cpp_compiler = os.environ.get('CXX', default_cpp_compiler)
151c_compiler = os.environ.get('CC', default_c_compiler)
152
Jenkinsb3a371b2018-05-23 11:36:53 +0100153if env['os'] == 'android' and ( 'clang++' not in cpp_compiler or 'clang' not in c_compiler ):
ggardete2542c92018-06-29 17:01:01 +0200154 print( "WARNING: Only clang is officially supported to build the Compute Library for Android")
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000155
Jenkinsb3a371b2018-05-23 11:36:53 +0100156if 'clang++' in cpp_compiler:
Jenkins0e205f72019-11-28 16:53:35 +0000157 env.Append(CXXFLAGS = ['-Wno-vla-extension'])
158elif 'armclang' in cpp_compiler:
159 pass
Anthony Barbierdbdab852017-06-23 15:42:00 +0100160else:
Jenkins0e205f72019-11-28 16:53:35 +0000161 env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100162
163if env['cppthreads']:
164 env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
165
166if env['openmp']:
Jenkinsb3a371b2018-05-23 11:36:53 +0100167 if 'clang++' in cpp_compiler:
ggardete2542c92018-06-29 17:01:01 +0200168 print( "Clang does not support OpenMP. Use scheduler=cpp.")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100169 Exit(1)
170
171 env.Append(CPPDEFINES = [('ARM_COMPUTE_OPENMP_SCHEDULER', 1)])
172 env.Append(CXXFLAGS = ['-fopenmp'])
173 env.Append(LINKFLAGS = ['-fopenmp'])
174
Jenkins36ccc902020-02-21 11:10:48 +0000175# Validate and define state
176if env['estate'] == 'auto':
177 if 'v7a' in env['arch']:
178 env['estate'] = '32'
179 else:
180 env['estate'] = '64'
181
182# Map legacy arch
183if 'arm64' in env['arch']:
184 env['estate'] = '64'
185
186if 'v7a' in env['estate'] and env['estate'] == '64':
187 print("ERROR: armv7a architecture has only 32-bit execution state")
188 Exit(1)
189
Jenkins0e205f72019-11-28 16:53:35 +0000190# Add architecture specific flags
Anthony Barbierdbdab852017-06-23 15:42:00 +0100191prefix = ""
Jenkins36ccc902020-02-21 11:10:48 +0000192if 'v7a' in env['arch']:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100193 env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
Jenkins6a7771e2020-05-28 11:28:36 +0100194 if env['os'] == 'android' or env['os'] == 'tizen':
Anthony Barbierdbdab852017-06-23 15:42:00 +0100195 env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
Jenkinsb9abeae2018-11-22 11:58:08 +0000196 else:
Jenkins36ccc902020-02-21 11:10:48 +0000197 env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
198elif 'v8' in env['arch']:
199 if 'sve' in env['arch']:
200 env.Append(CXXFLAGS = ['-march=armv8.2-a+sve+fp16+dotprod'])
201 elif 'v8.2-a' in env['arch']:
Jenkinsb9abeae2018-11-22 11:58:08 +0000202 env.Append(CXXFLAGS = ['-march=armv8.2-a+fp16']) # explicitly enable fp16 extension otherwise __ARM_FEATURE_FP16_VECTOR_ARITHMETIC is undefined
Jenkins36ccc902020-02-21 11:10:48 +0000203 else:
204 env.Append(CXXFLAGS = ['-march=armv8-a'])
205
206 if 'v8.6-a' in env['arch']:
Jenkins6a7771e2020-05-28 11:28:36 +0100207 env.Append(CPPDEFINES = ['V8P6', 'V8P6_BF', 'ARM_COMPUTE_FORCE_BF16'])
Jenkins36ccc902020-02-21 11:10:48 +0000208
209elif 'x86' in env['arch']:
210 if env['estate'] == '32':
211 env.Append(CCFLAGS = ['-m32'])
212 env.Append(LINKFLAGS = ['-m32'])
213 else:
214 env.Append(CXXFLAGS = ['-fPIC'])
215 env.Append(CCFLAGS = ['-m64'])
216 env.Append(LINKFLAGS = ['-m64'])
217
218# Define toolchain
219prefix = ""
220if 'x86' not in env['arch']:
221 if env['estate'] == '32':
222 if env['os'] == 'linux':
223 prefix = "arm-linux-gnueabihf-" if 'v7' in env['arch'] else "armv8l-linux-gnueabihf-"
224 elif env['os'] == 'bare_metal':
225 prefix = "arm-eabi-"
226 elif env['os'] == 'android':
227 prefix = "arm-linux-androideabi-"
Jenkins6a7771e2020-05-28 11:28:36 +0100228 elif env['os'] == 'tizen':
229 prefix = "armv7l-tizen-linux-gnueabi-"
Jenkins36ccc902020-02-21 11:10:48 +0000230 elif env['estate'] == '64' and 'v8' in env['arch']:
231 if env['os'] == 'linux':
232 prefix = "aarch64-linux-gnu-"
233 elif env['os'] == 'bare_metal':
234 prefix = "aarch64-elf-"
235 elif env['os'] == 'android':
236 prefix = "aarch64-linux-android-"
Jenkins6a7771e2020-05-28 11:28:36 +0100237 elif env['os'] == 'tizen':
238 prefix = "aarch64-tizen-linux-gnu-"
Anthony Barbierdbdab852017-06-23 15:42:00 +0100239
240if env['build'] == 'native':
241 prefix = ""
242
Jenkins514be652019-02-28 12:25:18 +0000243if env["toolchain_prefix"] != "":
244 prefix = env["toolchain_prefix"]
245
Jenkins36ccc902020-02-21 11:10:48 +0000246compiler_prefix = prefix
247if env["compiler_prefix"] != "":
248 compiler_prefix = env["compiler_prefix"]
249
250env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler
251env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler
Anthony Barbierdbdab852017-06-23 15:42:00 +0100252env['LD'] = prefix + "ld"
253env['AS'] = prefix + "as"
254env['AR'] = prefix + "ar"
255env['RANLIB'] = prefix + "ranlib"
Anthony Barbier46d59272017-05-04 09:15:15 +0100256
257if not GetOption("help"):
Anthony Barbierdbdab852017-06-23 15:42:00 +0100258 try:
bradford barr8d418ab2017-08-07 14:17:09 -0400259 compiler_ver = subprocess.check_output(env['CXX'].split() + ["-dumpversion"]).strip()
Anthony Barbierdbdab852017-06-23 15:42:00 +0100260 except OSError:
261 print("ERROR: Compiler '%s' not found" % env['CXX'])
262 Exit(1)
263
Jenkins0e205f72019-11-28 16:53:35 +0000264 if 'armclang' in cpp_compiler:
265 pass
266 elif 'clang++' not in cpp_compiler:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100267 if env['arch'] == 'arm64-v8.2-a' and not version_at_least(compiler_ver, '6.2.1'):
ggardete2542c92018-06-29 17:01:01 +0200268 print("GCC 6.2.1 or newer is required to compile armv8.2-a code")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100269 Exit(1)
270 elif env['arch'] == 'arm64-v8a' and not version_at_least(compiler_ver, '4.9'):
ggardete2542c92018-06-29 17:01:01 +0200271 print("GCC 4.9 or newer is required to compile NEON code for AArch64")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100272 Exit(1)
273
274 if version_at_least(compiler_ver, '6.1'):
275 env.Append(CXXFLAGS = ['-Wno-ignored-attributes'])
276
277 if compiler_ver == '4.8.3':
278 env.Append(CXXFLAGS = ['-Wno-array-bounds'])
279
Kaizen8938bd32017-09-28 14:38:23 +0100280if env['standalone']:
281 env.Append(CXXFLAGS = ['-fPIC'])
282 env.Append(LINKFLAGS = ['-static-libgcc','-static-libstdc++'])
283
Anthony Barbierdbdab852017-06-23 15:42:00 +0100284if env['Werror']:
285 env.Append(CXXFLAGS = ['-Werror'])
286
287if env['os'] == 'android':
288 env.Append(CPPDEFINES = ['ANDROID'])
Jenkins36ccc902020-02-21 11:10:48 +0000289 env.Append(LINKFLAGS = ['-pie', '-static-libstdc++', '-ldl'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100290elif env['os'] == 'bare_metal':
291 env.Append(LINKFLAGS = ['-static'])
Kaizen8938bd32017-09-28 14:38:23 +0100292 env.Append(LINKFLAGS = ['-specs=rdimon.specs'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100293 env.Append(CXXFLAGS = ['-fPIC'])
294 env.Append(CPPDEFINES = ['NO_MULTI_THREADING'])
Kaizen8938bd32017-09-28 14:38:23 +0100295 env.Append(CPPDEFINES = ['BARE_METAL'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100296
297if env['opencl']:
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000298 if env['os'] in ['bare_metal'] or env['standalone']:
Jenkinsb3a371b2018-05-23 11:36:53 +0100299 print("Cannot link OpenCL statically, which is required for bare metal / standalone builds")
Anthony Barbierdbdab852017-06-23 15:42:00 +0100300 Exit(1)
301
Jenkinsb3a371b2018-05-23 11:36:53 +0100302if env['gles_compute']:
303 if env['os'] in ['bare_metal'] or env['standalone']:
304 print("Cannot link OpenGLES statically, which is required for bare metal / standalone builds")
305 Exit(1)
306
307if env["os"] not in ["android", "bare_metal"] and (env['opencl'] or env['cppthreads']):
308 env.Append(LIBS = ['pthread'])
309
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000310if env['opencl'] or env['gles_compute']:
Anthony Barbierdbdab852017-06-23 15:42:00 +0100311 if env['embed_kernels']:
312 env.Append(CPPDEFINES = ['EMBEDDED_KERNELS'])
313
314if env['debug']:
315 env['asserts'] = True
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000316 env['logging'] = True
Anthony Barbierdbdab852017-06-23 15:42:00 +0100317 env.Append(CXXFLAGS = ['-O0','-g','-gdwarf-2'])
318 env.Append(CPPDEFINES = ['ARM_COMPUTE_DEBUG_ENABLED'])
319else:
Jenkins975dfe12019-09-02 11:47:54 +0100320 env.Append(CXXFLAGS = ['-O3'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100321
322if env['asserts']:
323 env.Append(CPPDEFINES = ['ARM_COMPUTE_ASSERTS_ENABLED'])
Kaizen8938bd32017-09-28 14:38:23 +0100324 env.Append(CXXFLAGS = ['-fstack-protector-strong'])
Anthony Barbierdbdab852017-06-23 15:42:00 +0100325
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000326if env['logging']:
327 env.Append(CPPDEFINES = ['ARM_COMPUTE_LOGGING_ENABLED'])
328
Anthony Barbierdbdab852017-06-23 15:42:00 +0100329env.Append(CPPPATH = ['#/include', "#"])
330env.Append(CXXFLAGS = env['extra_cxx_flags'])
Jenkinsb9abeae2018-11-22 11:58:08 +0000331env.Append(LINKFLAGS = env['extra_link_flags'])
332
333Default( install_include("arm_compute"))
334Default( install_include("support"))
Jenkins4ba87db2019-05-23 17:11:51 +0100335Default( install_include("utils"))
336for dirname in os.listdir("./include"):
337 Default( install_include("include/%s" % dirname))
Anthony Barbierdbdab852017-06-23 15:42:00 +0100338
Anthony Barbierdbdab852017-06-23 15:42:00 +0100339Export('version_at_least')
340
Anthony Barbierdbdab852017-06-23 15:42:00 +0100341
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000342if env['gles_compute'] and env['os'] != 'android':
343 env.Append(CPPPATH = ['#/include/linux'])
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000344
Jenkinsb9abeae2018-11-22 11:58:08 +0000345SConscript('./SConscript', variant_dir=build_path, duplicate=0)
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000346
Jenkins36ccc902020-02-21 11:10:48 +0000347if env['examples'] and env['exceptions']:
348 if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
349 print("WARNING: Building examples for bare metal and armv7a is not supported. Use examples=0")
350 Return()
Jenkinsb9abeae2018-11-22 11:58:08 +0000351 SConscript('./examples/SConscript', variant_dir='%s/examples' % build_path, duplicate=0)
Anthony Barbierdbdab852017-06-23 15:42:00 +0100352
Jenkins36ccc902020-02-21 11:10:48 +0000353if env['exceptions']:
354 if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
355 print("WARNING: Building tests for bare metal and armv7a is not supported")
356 Return()
Jenkinsb9abeae2018-11-22 11:58:08 +0000357 SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0)