Lines Matching full:env
121 def modifiable_flags_handler(env):
122 env['modifiable_flags'] = \
123 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
126 def symbols_handler(env):
127 env['symbols'] = 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
129 def Is32BitHost(env):
130 return env['host_arch'] in ['aarch32', 'i386']
132 def IsAArch64Host(env):
133 return env['host_arch'] == 'aarch64'
135 def CanTargetA32(env):
136 return 'a32' in env['target']
138 def CanTargetT32(env):
139 return 't32' in env['target']
141 def CanTargetAArch32(env):
142 return CanTargetA32(env) or CanTargetT32(env)
144 def CanTargetA64(env):
145 return 'a64' in env['target']
147 def CanTargetAArch64(env):
148 return CanTargetA64(env)
153 def simulator_handler(env):
154 if not IsAArch64Host(env) and CanTargetAArch64(env):
155 env['simulator'] = 'aarch64'
157 env['simulator'] = 'none'
162 def code_buffer_allocator_handler(env):
163 directives = util.GetCompilerDirectives(env)
165 env['code_buffer_allocator'] = 'mmap'
167 env['code_buffer_allocator'] = 'malloc'
170 def default_validator(env):
174 def simulator_validator(env):
175 if env['simulator'] == 'aarch64' and not CanTargetAArch64(env):
197 def validator(name, value, env):
209 def validator(name, value, env):
264 def RetrieveEnvironmentVariables(env):
266 if os.getenv(key): env[key] = os.getenv(key)
267 if os.getenv('LD_LIBRARY_PATH'): env['LIBPATH'] = os.getenv('LD_LIBRARY_PATH')
269 env.Append(CCFLAGS = os.getenv('CCFLAGS').split())
271 env.Append(CXXFLAGS = os.getenv('CXXFLAGS').split())
273 env.Append(LINKFLAGS = os.getenv('LINKFLAGS').split())
275 env['ENV']['TERM'] = os.getenv('TERM')
285 def target_handler(env):
287 if Is32BitHost(env):
290 env['target'] = list(set(['a32', 't32']))
292 env['target'] = list(set(['a64', 'a32', 't32']))
295 def target_validator(env):
297 if Is32BitHost(env) and CanTargetAArch64(env):
303 def ProcessTargetOption(env):
304 if env['target'] == []: target_handler(env)
306 if 'a32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A32']
307 if 't32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_T32']
308 if 'a64' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A64']
310 target_validator(env)
313 def ProcessBuildOptions(env):
317 if var in env and env[var]:
318 env[var] += options['all'][var]
320 env[var] = options['all'][var]
324 ProcessTargetOption(env)
327 env_dict = env.Dictionary()
339 validator(env)
346 env[var] += options[key_val_couple][var]
349 def ConfigureEnvironmentForCompiler(env):
350 if CanTargetA32(env) and CanTargetT32(env):
353 env.Append(CPPFLAGS = ['-Wmissing-noreturn'])
355 compiler = util.CompilerInformation(env)
361 env.Append(CPPFLAGS = ['-Wimplicit-fallthrough', '-Wshorten-64-to-32'])
365 env.Append(CPPFLAGS = ['-Wunreachable-code'])
371 if env['mode'] == 'release':
373 env.Append(CPPFLAGS = ['-Wno-maybe-uninitialized'])
378 if env['negative_testing'] == 'on' and env['mode'] == 'debug' \
380 env.Append(CPPFLAGS = ['-Wno-terminate'])
383 if 'std' in env and env['std'] == 'c++98':
384 env.Append(CPPFLAGS = ['-Wno-c++11-compat'])
387 if 'std' not in env or env['std'] == 'c++98':
388 env.Append(CPPFLAGS = ['-Wno-long-long'])
390 if 'std' in env and env['std'] in ['c++11', 'c++14']:
392 env.Append(CPPFLAGS = ['-Wsuggest-override'])
394 env.Append(CPPFLAGS = ['-Winconsistent-missing-override'])
397 def ConfigureEnvironment(env):
398 RetrieveEnvironmentVariables(env)
399 env['host_arch'] = util.GetHostArch(env)
400 ProcessBuildOptions(env)
401 if 'std' in env:
402 env.Append(CPPFLAGS = ['-std=' + env['std']])
403 std_path = env['std']
404 ConfigureEnvironmentForCompiler(env)
407 def TargetBuildDir(env):
412 option_value = ''.join(env[option]) if option in env else ''
423 def VIXLLibraryTarget(env):
424 build_dir = TargetBuildDir(env)
433 if CanTargetAArch32(env):
436 if CanTargetAArch64(env):
439 return env.Library(join(build_dir, 'vixl'), sources)
446 env = Environment(variables = vars,
457 ConfigureEnvironment(env)
458 Help(vars.GenerateHelpText(env))
459 libvixl = VIXLLibraryTarget(env)
461 env.Alias('libvixl', libvixl)
466 test_build_dir = PrepareVariantDir('test', TargetBuildDir(env))
467 test_objects = [env.Object(Glob(join(test_build_dir, '*.cc')))]
470 if CanTargetAArch32(env):
473 aarch32_examples_build_dir = PrepareVariantDir('examples/aarch32', TargetBuildDir(env))
476 prog = env.Program(join(aarch32_examples_build_dir, example),
480 env.Alias('aarch32_examples', aarch32_example_targets)
485 aarch32_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch32', TargetBuildDir(env))
488 prog = env.Program(join(aarch32_benchmarks_build_dir, bench),
492 env.Alias('aarch32_benchmarks', aarch32_benchmark_targets)
496 test_aarch32_build_dir = PrepareVariantDir(join('test', 'aarch32'), TargetBuildDir(env))
497 test_objects.append(env.Object(
499 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
502 if CanTargetAArch64(env):
505 aarch64_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch64', TargetBuildDir(env))
508 prog = env.Program(join(aarch64_benchmarks_build_dir, bench),
512 env.Alias('aarch64_benchmarks', aarch64_benchmark_targets)
517 aarch64_examples_build_dir = PrepareVariantDir('examples/aarch64', TargetBuildDir(env))
520 prog = env.Program(join(aarch64_examples_build_dir, example),
524 env.Alias('aarch64_examples', aarch64_example_targets)
528 test_aarch64_build_dir = PrepareVariantDir(join('test', 'aarch64'), TargetBuildDir(env))
529 test_objects.append(env.Object(
531 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
535 test_aarch64_examples_vdir = join(TargetBuildDir(env), 'test', 'aarch64', 'test_examples')
537 test_aarch64_examples_obj = env.Object(
540 CCFLAGS = env['CCFLAGS'] + ['-DTEST_EXAMPLES'],
541 CPPPATH = env['CPPPATH'] + [config.dir_aarch64_examples] + [config.dir_tests])
544 test = env.Program(join(test_build_dir, 'test-runner'), test_objects,
546 env.Alias('tests', test)
550 env.Alias('all', top_level_targets.targets)
559 env.Markdown('README.md'),
560 env.Markdown('doc/changelog.md'),
561 env.Markdown('doc/aarch32/getting-started-aarch32.md'),
562 env.Markdown('doc/aarch32/design/code-generation-aarch32.md'),
563 env.Markdown('doc/aarch32/design/literal-pool-aarch32.md'),
564 env.Markdown('doc/aarch64/supported-instructions-aarch64.md'),
565 env.Markdown('doc/aarch64/getting-started-aarch64.md'),
566 env.Markdown('doc/aarch64/topics/ycm.md'),
567 env.Markdown('doc/aarch64/topics/extending-the-disassembler.md'),
568 env.Markdown('doc/aarch64/topics/index.md'),
570 env.Alias('doc', doc)