blob: 758f7aec05cf33fb092745e78e2f8134a548b366 [file] [log] [blame]
Alexandre Ramesb78f1392016-07-01 14:22:22 +01001# Copyright 2015, VIXL authors
armvixlad96eda2013-06-14 11:42:37 +01002# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are met:
6#
7# * Redistributions of source code must retain the above copyright notice,
8# this list of conditions and the following disclaimer.
9# * Redistributions in binary form must reproduce the above copyright notice,
10# this list of conditions and the following disclaimer in the documentation
11# and/or other materials provided with the distribution.
12# * Neither the name of ARM Limited nor the names of its contributors may be
13# used to endorse or promote products derived from this software without
14# specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND
17# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
armvixldb644342015-07-21 11:37:10 +010027import glob
armvixlad96eda2013-06-14 11:42:37 +010028import os
armvixldb644342015-07-21 11:37:10 +010029from os.path import join
armvixlc68cb642014-09-25 18:49:30 +010030import platform
armvixl4a102ba2014-07-14 09:02:40 +010031import subprocess
armvixlad96eda2013-06-14 11:42:37 +010032import sys
Pierre Langloisa3b21462016-08-04 16:01:51 +010033from collections import OrderedDict
armvixlad96eda2013-06-14 11:42:37 +010034
armvixl4a102ba2014-07-14 09:02:40 +010035root_dir = os.path.dirname(File('SConstruct').rfile().abspath)
armvixldb644342015-07-21 11:37:10 +010036sys.path.insert(0, join(root_dir, 'tools'))
37import config
armvixl4a102ba2014-07-14 09:02:40 +010038import util
39
armvixlc68cb642014-09-25 18:49:30 +010040
41Help('''
42Build system for the VIXL project.
43See README.md for documentation and details about the build system.
armvixlc68cb642014-09-25 18:49:30 +010044''')
45
46
armvixldb644342015-07-21 11:37:10 +010047# We track top-level targets to automatically generate help and alias them.
48class TopLevelTargets:
49 def __init__(self):
50 self.targets = []
51 self.help_messages = []
52 def Add(self, target, help_message):
53 self.targets.append(target)
54 self.help_messages.append(help_message)
55 def Help(self):
armvixl684cd2a2015-10-23 13:38:33 +010056 res = ""
armvixldb644342015-07-21 11:37:10 +010057 for i in range(len(self.targets)):
58 res += '\t{0:<{1}}{2:<{3}}\n'.format(
59 'scons ' + self.targets[i],
60 len('scons ') + max(map(len, self.targets)),
61 ' : ' + self.help_messages[i],
62 len(' : ') + max(map(len, self.help_messages)))
63 return res
armvixlad96eda2013-06-14 11:42:37 +010064
armvixldb644342015-07-21 11:37:10 +010065top_level_targets = TopLevelTargets()
armvixlad96eda2013-06-14 11:42:37 +010066
67
armvixldb644342015-07-21 11:37:10 +010068
69# Build options ----------------------------------------------------------------
70
71# Store all the options in a dictionary.
72# The SConstruct will check the build variables and construct the build
73# environment as appropriate.
74options = {
75 'all' : { # Unconditionally processed.
76 'CCFLAGS' : ['-Wall',
77 '-Werror',
78 '-fdiagnostics-show-option',
79 '-Wextra',
80 '-Wredundant-decls',
81 '-pedantic',
armvixl684cd2a2015-10-23 13:38:33 +010082 '-Wmissing-noreturn',
Alexandre Ramesfd098172016-08-09 10:29:53 +010083 '-Wwrite-strings',
84 '-Wunused'],
armvixldb644342015-07-21 11:37:10 +010085 'CPPPATH' : [config.dir_src_vixl]
86 },
87# 'build_option:value' : {
88# 'environment_key' : 'values to append'
89# },
90 'mode:debug' : {
91 'CCFLAGS' : ['-DVIXL_DEBUG', '-O0']
92 },
93 'mode:release' : {
Alexandre Ramesfa4a4bd2016-07-25 14:14:22 +010094 'CCFLAGS' : ['-O3'],
armvixldb644342015-07-21 11:37:10 +010095 },
Alexandre Ramesd5bfa5a2016-10-25 09:55:51 +010096 'target_arch:aarch32' : {
Alexandre Rames586c6b92016-10-24 11:59:33 +010097 'CCFLAGS' : ['-DVIXL_INCLUDE_TARGET_AARCH32']
98 },
Alexandre Ramesd5bfa5a2016-10-25 09:55:51 +010099 'target_arch:aarch64' : {
Alexandre Rames586c6b92016-10-24 11:59:33 +0100100 'CCFLAGS' : ['-DVIXL_INCLUDE_TARGET_AARCH64']
101 },
Alexandre Ramesd5bfa5a2016-10-25 09:55:51 +0100102 'target_arch:both' : {
Alexandre Ramesa3aef4f2016-10-28 15:39:51 +0100103 'CCFLAGS' : ['-DVIXL_INCLUDE_TARGET_AARCH32',
104 '-DVIXL_INCLUDE_TARGET_AARCH64']
Alexandre Rames586c6b92016-10-24 11:59:33 +0100105 },
Pierre Langloisa3b21462016-08-04 16:01:51 +0100106 'simulator:aarch64' : {
Pierre Langlois1e85b7f2016-08-05 14:20:36 +0100107 'CCFLAGS' : ['-DVIXL_INCLUDE_SIMULATOR_AARCH64'],
armvixldb644342015-07-21 11:37:10 +0100108 },
109 'symbols:on' : {
110 'CCFLAGS' : ['-g'],
111 'LINKFLAGS' : ['-g']
112 },
113 }
armvixlad96eda2013-06-14 11:42:37 +0100114
115
armvixldb644342015-07-21 11:37:10 +0100116# A `DefaultVariable` has a default value that depends on elements not known
117# when variables are first evaluated.
118# Each `DefaultVariable` has a handler that will compute the default value for
119# the given environment.
120def modifiable_flags_handler(env):
121 env['modifiable_flags'] = \
122 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
armvixl6e2c8272015-03-31 11:04:14 +0100123
124
armvixldb644342015-07-21 11:37:10 +0100125def symbols_handler(env):
126 env['symbols'] = 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
armvixlad96eda2013-06-14 11:42:37 +0100127
128
Pierre Langloisa3b21462016-08-04 16:01:51 +0100129# The architecture targeted by default will depend on the compiler being
130# used. 'host_arch' is extracted from the compiler while 'target_arch' can be
131# set by the user.
132# By default, we target both AArch32 and AArch64 unless the compiler
133# targets AArch32. At the moment, we cannot build VIXL's AArch64 support on a 32
134# bit platform.
135# TODO: Port VIXL to build on a 32 bit platform.
136def target_arch_handler(env):
137 if env['host_arch'] == 'aarch32':
138 env['target_arch'] = 'aarch32'
139 else:
140 env['target_arch'] = 'both'
141
142
143# By default, include the simulator only if AArch64 is targeted and we are not
144# building VIXL natively for AArch64.
145def simulator_handler(env):
146 if env['host_arch'] != 'aarch64' and \
147 env['target_arch'] in ['aarch64', 'both']:
148 env['simulator'] = 'aarch64'
149 else:
150 env['simulator'] = 'none'
151
152
153# Default variables may depend on each other, therefore we need this dictionnary
154# to be ordered.
155vars_default_handlers = OrderedDict({
armvixldb644342015-07-21 11:37:10 +0100156 # variable_name : [ 'default val', 'handler' ]
157 'symbols' : [ 'mode==debug', symbols_handler ],
Pierre Langloisa3b21462016-08-04 16:01:51 +0100158 'modifiable_flags' : [ 'mode==debug', modifiable_flags_handler ],
159 'target_arch' : [ 'same as host architecture if running on AArch32 - '
160 'otherwise both',
161 target_arch_handler ],
162 'simulator' : ['on if the target architectures include AArch64 but '
163 'the host is not AArch64, else off',
164 simulator_handler ]
165 })
armvixldb644342015-07-21 11:37:10 +0100166
167
Pierre Langloisa3b21462016-08-04 16:01:51 +0100168def DefaultVariable(name, help, allowed_values):
169 help = '%s (%s)' % (help, '|'.join(allowed_values))
armvixldb644342015-07-21 11:37:10 +0100170 default_value = vars_default_handlers[name][0]
Pierre Langloisa3b21462016-08-04 16:01:51 +0100171 def validator(name, value, env):
172 if value != default_value and value not in allowed_values:
173 raise SCons.Errors.UserError(
174 'Invalid value for option {name}: {value}. '
175 'Valid values are: {allowed_values}'.format(name,
176 value,
177 allowed_values))
178 return (name, help, default_value, validator)
armvixldb644342015-07-21 11:37:10 +0100179
180
181vars = Variables()
182# Define command line build options.
armvixldb644342015-07-21 11:37:10 +0100183vars.AddVariables(
184 EnumVariable('mode', 'Build mode',
185 'release', allowed_values=config.build_options_modes),
186 DefaultVariable('symbols', 'Include debugging symbols in the binaries',
187 ['on', 'off']),
Pierre Langloisa3b21462016-08-04 16:01:51 +0100188 DefaultVariable('target_arch', 'Target architecture',
189 ['aarch32', 'aarch64', 'both']),
190 DefaultVariable('simulator', 'Simulators to include', ['aarch64', 'none']),
armvixldb644342015-07-21 11:37:10 +0100191 ('std', 'C++ standard. The standards tested are: %s.' % \
192 ', '.join(config.tested_cpp_standards))
193 )
armvixlad96eda2013-06-14 11:42:37 +0100194
armvixldb644342015-07-21 11:37:10 +0100195# We use 'variant directories' to avoid recompiling multiple times when build
196# options are changed, different build paths are used depending on the options
197# set. These are the options that should be reflected in the build directory
198# path.
Pierre Langloisa3b21462016-08-04 16:01:51 +0100199options_influencing_build_path = [
200 'target_arch', 'mode', 'symbols', 'CXX', 'std', 'simulator'
201]
armvixlad96eda2013-06-14 11:42:37 +0100202
armvixlad96eda2013-06-14 11:42:37 +0100203
armvixldb644342015-07-21 11:37:10 +0100204
205# Build helpers ----------------------------------------------------------------
206
207def RetrieveEnvironmentVariables(env):
Pierre Langlois88c46b82016-06-02 18:15:32 +0100208 for key in ['CC', 'CXX', 'AR', 'RANLIB', 'LD']:
armvixldb644342015-07-21 11:37:10 +0100209 if os.getenv(key): env[key] = os.getenv(key)
210 if os.getenv('LD_LIBRARY_PATH'): env['LIBPATH'] = os.getenv('LD_LIBRARY_PATH')
Pierre Langlois88c46b82016-06-02 18:15:32 +0100211 if os.getenv('CCFLAGS'):
212 env.Append(CCFLAGS = os.getenv('CCFLAGS').split())
armvixldb644342015-07-21 11:37:10 +0100213 if os.getenv('CXXFLAGS'):
214 env.Append(CXXFLAGS = os.getenv('CXXFLAGS').split())
215 if os.getenv('LINKFLAGS'):
216 env.Append(LINKFLAGS = os.getenv('LINKFLAGS').split())
217 # This allows colors to be displayed when using with clang.
218 env['ENV']['TERM'] = os.getenv('TERM')
armvixl4a102ba2014-07-14 09:02:40 +0100219
220
armvixldb644342015-07-21 11:37:10 +0100221def ProcessBuildOptions(env):
222 # 'all' is unconditionally processed.
223 if 'all' in options:
224 for var in options['all']:
225 if var in env and env[var]:
226 env[var] += options['all'][var]
227 else:
228 env[var] = options['all'][var]
Pierre Langloisa3b21462016-08-04 16:01:51 +0100229
armvixldb644342015-07-21 11:37:10 +0100230 # Other build options must match 'option:value'
231 env_dict = env.Dictionary()
Pierre Langloisa3b21462016-08-04 16:01:51 +0100232
233 # First apply the default variables handlers in order.
234 for key, value in vars_default_handlers.items():
235 default = value[0]
236 handler = value[1]
237 if env_dict.get(key) == default:
238 handler(env_dict)
239
armvixldb644342015-07-21 11:37:10 +0100240 for key in env_dict.keys():
armvixldb644342015-07-21 11:37:10 +0100241 # Then update the environment according to the value of the variable.
242 key_val_couple = key + ':%s' % env_dict[key]
243 if key_val_couple in options:
244 for var in options[key_val_couple]:
245 env[var] += options[key_val_couple][var]
246
247
248def ConfigureEnvironmentForCompiler(env):
Pierre Langloisf737e0a2016-11-02 13:08:11 +0000249 compiler = util.CompilerInformation(env['CXX'])
250 if compiler == 'clang':
armvixldb644342015-07-21 11:37:10 +0100251 # These warnings only work for Clang.
252 # -Wimplicit-fallthrough only works when compiling the code base as C++11 or
253 # newer. The compiler does not complain if the option is passed when
254 # compiling earlier C++ standards.
255 env.Append(CPPFLAGS = ['-Wimplicit-fallthrough', '-Wshorten-64-to-32'])
256
257 # The '-Wunreachable-code' flag breaks builds for clang 3.4.
Jacob Bramley176a3792016-11-09 14:44:39 +0000258 if compiler != 'clang-3.4':
armvixldb644342015-07-21 11:37:10 +0100259 env.Append(CPPFLAGS = ['-Wunreachable-code'])
260
261 # GCC 4.8 has a bug which produces a warning saying that an anonymous Operand
262 # object might be used uninitialized:
263 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57045
264 # The bug does not seem to appear in GCC 4.7, or in debug builds with GCC 4.8.
265 if env['mode'] == 'release':
Pierre Langloisf737e0a2016-11-02 13:08:11 +0000266 if compiler == 'gcc-4.8':
armvixldb644342015-07-21 11:37:10 +0100267 env.Append(CPPFLAGS = ['-Wno-maybe-uninitialized'])
Pierre Langloisf737e0a2016-11-02 13:08:11 +0000268
Pierre Langloisc1253072016-06-15 14:36:10 +0100269 # When compiling with c++98 (the default), allow long long constants.
armvixl0f35e362016-05-10 13:57:58 +0100270 if 'std' not in env or env['std'] == 'c++98':
Pierre Langloisc1253072016-06-15 14:36:10 +0100271 env.Append(CPPFLAGS = ['-Wno-long-long'])
Pierre Langlois3fac43c2016-10-31 13:38:47 +0000272 # When compiling with c++11, suggest missing override keywords on methods.
273 if 'std' in env and env['std'] in ['c++11', 'c++14']:
Pierre Langloisf737e0a2016-11-02 13:08:11 +0000274 if compiler >= 'gcc-5':
Pierre Langlois3fac43c2016-10-31 13:38:47 +0000275 env.Append(CPPFLAGS = ['-Wsuggest-override'])
Pierre Langloisf737e0a2016-11-02 13:08:11 +0000276 elif compiler >= 'clang-3.6':
Pierre Langlois3fac43c2016-10-31 13:38:47 +0000277 env.Append(CPPFLAGS = ['-Winconsistent-missing-override'])
armvixldb644342015-07-21 11:37:10 +0100278
279
280def ConfigureEnvironment(env):
281 RetrieveEnvironmentVariables(env)
Pierre Langloisa3b21462016-08-04 16:01:51 +0100282 env['host_arch'] = util.GetHostArch(env['CXX'])
armvixldb644342015-07-21 11:37:10 +0100283 ProcessBuildOptions(env)
284 if 'std' in env:
285 env.Append(CPPFLAGS = ['-std=' + env['std']])
286 std_path = env['std']
287 ConfigureEnvironmentForCompiler(env)
288
289
290def TargetBuildDir(env):
291 # Build-time option values are embedded in the build path to avoid requiring a
292 # full build when an option changes.
293 build_dir = config.dir_build
294 for option in options_influencing_build_path:
295 option_value = env[option] if option in env else ''
296 build_dir = join(build_dir, option + '_'+ option_value)
297 return build_dir
298
299
300def PrepareVariantDir(location, build_dir):
301 location_build_dir = join(build_dir, location)
302 VariantDir(location_build_dir, location)
303 return location_build_dir
304
305
306def VIXLLibraryTarget(env):
307 build_dir = TargetBuildDir(env)
308 # Create a link to the latest build directory.
Alexandre Rames4e241932016-06-08 21:32:03 +0100309 # Use `-r` to avoid failure when `latest` exists and is a directory.
310 subprocess.check_call(["rm", "-rf", config.dir_build_latest])
armvixldb644342015-07-21 11:37:10 +0100311 util.ensure_dir(build_dir)
312 subprocess.check_call(["ln", "-s", build_dir, config.dir_build_latest])
Alexandre Ramesd3832962016-07-04 15:03:43 +0100313 # Source files are in `src` and in `src/aarch64/`.
Alexandre Rames39c32a62016-05-23 15:47:22 +0100314 variant_dir_vixl = PrepareVariantDir(join('src'), build_dir)
Pierre Langloisa3b21462016-08-04 16:01:51 +0100315 sources = [Glob(join(variant_dir_vixl, '*.cc'))]
316 if env['target_arch'] in ['aarch32', 'both']:
317 variant_dir_aarch32 = PrepareVariantDir(join('src', 'aarch32'), build_dir)
318 sources.append(Glob(join(variant_dir_aarch32, '*.cc')))
319 if env['target_arch'] in ['aarch64', 'both']:
320 variant_dir_aarch64 = PrepareVariantDir(join('src', 'aarch64'), build_dir)
321 sources.append(Glob(join(variant_dir_aarch64, '*.cc')))
armvixldb644342015-07-21 11:37:10 +0100322 return env.Library(join(build_dir, 'vixl'), sources)
323
324
325
326# Build ------------------------------------------------------------------------
327
328# The VIXL library, built by default.
329env = Environment(variables = vars)
Alexandre Ramesf5de33d2016-10-25 09:51:11 +0100330# Abort the build if any command line option is unknown or invalid.
331unknown_build_options = vars.UnknownVariables()
332if unknown_build_options:
333 print 'Unknown build options:', unknown_build_options.keys()
334 Exit(1)
335
armvixldb644342015-07-21 11:37:10 +0100336ConfigureEnvironment(env)
armvixldb644342015-07-21 11:37:10 +0100337Help(vars.GenerateHelpText(env))
338libvixl = VIXLLibraryTarget(env)
339Default(libvixl)
340env.Alias('libvixl', libvixl)
341top_level_targets.Add('', 'Build the VIXL library.')
342
armvixl4a102ba2014-07-14 09:02:40 +0100343
Pierre Langloisa3b21462016-08-04 16:01:51 +0100344# Common test code.
armvixldb644342015-07-21 11:37:10 +0100345test_build_dir = PrepareVariantDir('test', TargetBuildDir(env))
Pierre Langlois88c46b82016-06-02 18:15:32 +0100346test_objects = [env.Object(Glob(join(test_build_dir, '*.cc')))]
347
Pierre Langloisa3b21462016-08-04 16:01:51 +0100348# AArch32 support
349if env['target_arch'] in ['aarch32', 'both']:
350 # The examples.
351 aarch32_example_names = util.ListCCFilesWithoutExt(config.dir_aarch32_examples)
352 aarch32_examples_build_dir = PrepareVariantDir('examples/aarch32', TargetBuildDir(env))
353 aarch32_example_targets = []
354 for example in aarch32_example_names:
355 prog = env.Program(join(aarch32_examples_build_dir, example),
356 join(aarch32_examples_build_dir, example + '.cc'),
357 LIBS=[libvixl])
358 aarch32_example_targets.append(prog)
359 env.Alias('aarch32_examples', aarch32_example_targets)
360 top_level_targets.Add('aarch32_examples', 'Build the examples for AArch32.')
Pierre Langlois88c46b82016-06-02 18:15:32 +0100361
Vincent Belliard32cf2542016-07-14 10:04:09 -0700362 # The benchmarks
363 aarch32_benchmark_names = util.ListCCFilesWithoutExt(config.dir_aarch32_benchmarks)
364 aarch32_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch32', TargetBuildDir(env))
365 aarch32_benchmark_targets = []
366 for bench in aarch32_benchmark_names:
367 prog = env.Program(join(aarch32_benchmarks_build_dir, bench),
368 join(aarch32_benchmarks_build_dir, bench + '.cc'),
369 LIBS=[libvixl])
370 aarch32_benchmark_targets.append(prog)
371 env.Alias('aarch32_benchmarks', aarch32_benchmark_targets)
372 top_level_targets.Add('aarch32_benchmarks', 'Build the benchmarks for AArch32.')
373
Pierre Langloisa3b21462016-08-04 16:01:51 +0100374 # The tests.
375 test_aarch32_build_dir = PrepareVariantDir(join('test', 'aarch32'), TargetBuildDir(env))
376 test_objects.append(env.Object(
377 Glob(join(test_aarch32_build_dir, '*.cc')),
378 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
Pierre Langlois88c46b82016-06-02 18:15:32 +0100379
Pierre Langloisa3b21462016-08-04 16:01:51 +0100380# AArch64 support
381if env['target_arch'] in ['aarch64', 'both']:
382 # The benchmarks.
383 aarch64_benchmark_names = util.ListCCFilesWithoutExt(config.dir_aarch64_benchmarks)
384 aarch64_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch64', TargetBuildDir(env))
385 aarch64_benchmark_targets = []
386 for bench in aarch64_benchmark_names:
387 prog = env.Program(join(aarch64_benchmarks_build_dir, bench),
388 join(aarch64_benchmarks_build_dir, bench + '.cc'),
389 LIBS=[libvixl])
390 aarch64_benchmark_targets.append(prog)
391 env.Alias('aarch64_benchmarks', aarch64_benchmark_targets)
392 top_level_targets.Add('aarch64_benchmarks', 'Build the benchmarks for AArch64.')
393
394 # The examples.
395 aarch64_example_names = util.ListCCFilesWithoutExt(config.dir_aarch64_examples)
396 aarch64_examples_build_dir = PrepareVariantDir('examples/aarch64', TargetBuildDir(env))
397 aarch64_example_targets = []
398 for example in aarch64_example_names:
399 prog = env.Program(join(aarch64_examples_build_dir, example),
400 join(aarch64_examples_build_dir, example + '.cc'),
401 LIBS=[libvixl])
402 aarch64_example_targets.append(prog)
403 env.Alias('aarch64_examples', aarch64_example_targets)
404 top_level_targets.Add('aarch64_examples', 'Build the examples for AArch64.')
405
406 # The tests.
407 test_aarch64_build_dir = PrepareVariantDir(join('test', 'aarch64'), TargetBuildDir(env))
408 test_objects.append(env.Object(
409 Glob(join(test_aarch64_build_dir, '*.cc')),
410 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
411
412 # The test requires building the example files with specific options, so we
413 # create a separate variant dir for the example objects built this way.
414 test_aarch64_examples_vdir = join(TargetBuildDir(env), 'test', 'aarch64', 'test_examples')
415 VariantDir(test_aarch64_examples_vdir, '.')
416 test_aarch64_examples_obj = env.Object(
417 [Glob(join(test_aarch64_examples_vdir, join('test', 'aarch64', 'examples/aarch64', '*.cc'))),
418 Glob(join(test_aarch64_examples_vdir, join('examples/aarch64', '*.cc')))],
419 CCFLAGS = env['CCFLAGS'] + ['-DTEST_EXAMPLES'],
420 CPPPATH = env['CPPPATH'] + [config.dir_aarch64_examples] + [config.dir_tests])
421 test_objects.append(test_aarch64_examples_obj)
Pierre Langlois88c46b82016-06-02 18:15:32 +0100422
423test = env.Program(join(test_build_dir, 'test-runner'), test_objects,
armvixldb644342015-07-21 11:37:10 +0100424 LIBS=[libvixl])
425env.Alias('tests', test)
426top_level_targets.Add('tests', 'Build the tests.')
armvixl4a102ba2014-07-14 09:02:40 +0100427
armvixl4a102ba2014-07-14 09:02:40 +0100428
armvixldb644342015-07-21 11:37:10 +0100429env.Alias('all', top_level_targets.targets)
430top_level_targets.Add('all', 'Build all the targets above.')
431
432Help('\n\nAvailable top level targets:\n' + top_level_targets.Help())