• Home
  • Raw
  • Download

Lines Matching full:env

125 def modifiable_flags_handler(env):
126 env['modifiable_flags'] = \
127 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
130 def symbols_handler(env):
131 env['symbols'] = 'on' if 'mode' in env and env['mode'] == 'debug' else 'off'
133 def Is32BitHost(env):
134 return env['host_arch'] in ['aarch32', 'i386']
136 def IsAArch64Host(env):
137 return env['host_arch'] == 'aarch64'
139 def CanTargetA32(env):
140 return 'a32' in env['target']
142 def CanTargetT32(env):
143 return 't32' in env['target']
145 def CanTargetAArch32(env):
146 return CanTargetA32(env) or CanTargetT32(env)
148 def CanTargetA64(env):
149 return 'a64' in env['target']
151 def CanTargetAArch64(env):
152 return CanTargetA64(env)
157 def simulator_handler(env):
158 if not IsAArch64Host(env) and CanTargetAArch64(env):
159 env['simulator'] = 'aarch64'
161 env['simulator'] = 'none'
166 def code_buffer_allocator_handler(env):
167 directives = util.GetCompilerDirectives(env)
169 env['code_buffer_allocator'] = 'mmap'
171 env['code_buffer_allocator'] = 'malloc'
174 def default_validator(env):
178 def simulator_validator(env):
179 if env['simulator'] == 'aarch64' and not CanTargetAArch64(env):
201 def validator(name, value, env):
213 def validator(name, value, env):
270 def RetrieveEnvironmentVariables(env):
272 if os.getenv(key): env[key] = os.getenv(key)
273 if os.getenv('LD_LIBRARY_PATH'): env['LIBPATH'] = os.getenv('LD_LIBRARY_PATH')
275 env.Append(CCFLAGS = os.getenv('CCFLAGS').split())
277 env.Append(CXXFLAGS = os.getenv('CXXFLAGS').split())
279 env.Append(LINKFLAGS = os.getenv('LINKFLAGS').split())
281 env['ENV']['TERM'] = os.getenv('TERM')
291 def target_handler(env):
293 if Is32BitHost(env):
296 env['target'] = list(set(['a32', 't32']))
298 env['target'] = list(set(['a64', 'a32', 't32']))
301 def target_validator(env):
303 if Is32BitHost(env) and CanTargetAArch64(env):
309 def ProcessTargetOption(env):
310 if env['target'] == []: target_handler(env)
312 if 'a32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A32']
313 if 't32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_T32']
314 if 'a64' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A64']
316 target_validator(env)
319 def ProcessBuildOptions(env):
323 if var in env and env[var]:
324 env[var] += options['all'][var]
326 env[var] = options['all'][var]
330 ProcessTargetOption(env)
333 env_dict = env.Dictionary()
345 validator(env)
352 env[var] += options[key_val_couple][var]
355 def ConfigureEnvironmentForCompiler(env):
356 if CanTargetA32(env) and CanTargetT32(env):
359 env.Append(CPPFLAGS = ['-Wmissing-noreturn'])
361 compiler = util.CompilerInformation(env)
367 env.Append(CPPFLAGS = ['-Wimplicit-fallthrough', '-Wshorten-64-to-32'])
371 env.Append(CPPFLAGS = ['-Wunreachable-code'])
373 if env['ubsan'] == 'on':
374 env.Append(LINKFLAGS = ['-fuse-ld=lld'])
380 if env['mode'] == 'release':
382 env.Append(CPPFLAGS = ['-Wno-maybe-uninitialized'])
387 if env['negative_testing'] == 'on' and env['mode'] == 'debug' \
389 env.Append(CPPFLAGS = ['-Wno-terminate'])
392 if 'std' in env and env['std'] == 'c++98':
393 env.Append(CPPFLAGS = ['-Wno-c++11-compat'])
396 if 'std' not in env or env['std'] == 'c++98':
397 env.Append(CPPFLAGS = ['-Wno-long-long'])
398 env.Append(CPPFLAGS = ['-Wno-variadic-macros'])
400 if 'std' in env and env['std'] in ['c++11', 'c++14']:
402 env.Append(CPPFLAGS = ['-Wsuggest-override'])
404 env.Append(CPPFLAGS = ['-Winconsistent-missing-override'])
407 def ConfigureEnvironment(env):
408 RetrieveEnvironmentVariables(env)
409 env['host_arch'] = util.GetHostArch(env)
410 ProcessBuildOptions(env)
411 if 'std' in env:
412 env.Append(CPPFLAGS = ['-std=' + env['std']])
413 std_path = env['std']
414 ConfigureEnvironmentForCompiler(env)
417 def TargetBuildDir(env):
422 option_value = ''.join(env[option]) if option in env else ''
433 def VIXLLibraryTarget(env):
434 build_dir = TargetBuildDir(env)
443 if CanTargetAArch32(env):
446 if CanTargetAArch64(env):
449 return env.Library(join(build_dir, 'vixl'), sources)
456 env = Environment(variables = vars,
467 ConfigureEnvironment(env)
468 Help(vars.GenerateHelpText(env))
469 libvixl = VIXLLibraryTarget(env)
471 env.Alias('libvixl', libvixl)
476 test_build_dir = PrepareVariantDir('test', TargetBuildDir(env))
477 test_objects = [env.Object(Glob(join(test_build_dir, '*.cc')))]
480 if CanTargetAArch32(env):
483 aarch32_examples_build_dir = PrepareVariantDir('examples/aarch32', TargetBuildDir(env))
486 prog = env.Program(join(aarch32_examples_build_dir, example),
490 env.Alias('aarch32_examples', aarch32_example_targets)
495 aarch32_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch32', TargetBuildDir(env))
498 prog = env.Program(join(aarch32_benchmarks_build_dir, bench),
502 env.Alias('aarch32_benchmarks', aarch32_benchmark_targets)
506 test_aarch32_build_dir = PrepareVariantDir(join('test', 'aarch32'), TargetBuildDir(env))
507 test_objects.append(env.Object(
509 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
512 if CanTargetAArch64(env):
515 aarch64_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch64', TargetBuildDir(env))
518 prog = env.Program(join(aarch64_benchmarks_build_dir, bench),
522 env.Alias('aarch64_benchmarks', aarch64_benchmark_targets)
527 aarch64_examples_build_dir = PrepareVariantDir('examples/aarch64', TargetBuildDir(env))
530 prog = env.Program(join(aarch64_examples_build_dir, example),
534 env.Alias('aarch64_examples', aarch64_example_targets)
538 test_aarch64_build_dir = PrepareVariantDir(join('test', 'aarch64'), TargetBuildDir(env))
539 test_objects.append(env.Object(
541 CPPPATH = env['CPPPATH'] + [config.dir_tests]))
545 test_aarch64_examples_vdir = join(TargetBuildDir(env), 'test', 'aarch64', 'test_examples')
547 test_aarch64_examples_obj = env.Object(
550 CCFLAGS = env['CCFLAGS'] + ['-DTEST_EXAMPLES'],
551 CPPPATH = env['CPPPATH'] + [config.dir_aarch64_examples] + [config.dir_tests])
554 test = env.Program(join(test_build_dir, 'test-runner'), test_objects,
556 env.Alias('tests', test)
560 env.Alias('all', top_level_targets.targets)
569 env.Markdown('README.md'),
570 env.Markdown('doc/changelog.md'),
571 env.Markdown('doc/aarch32/getting-started-aarch32.md'),
572 env.Markdown('doc/aarch32/design/code-generation-aarch32.md'),
573 env.Markdown('doc/aarch32/design/literal-pool-aarch32.md'),
574 env.Markdown('doc/aarch64/supported-instructions-aarch64.md'),
575 env.Markdown('doc/aarch64/getting-started-aarch64.md'),
576 env.Markdown('doc/aarch64/topics/ycm.md'),
577 env.Markdown('doc/aarch64/topics/extending-the-disassembler.md'),
578 env.Markdown('doc/aarch64/topics/index.md'),
580 env.Alias('doc', doc)