Added options to compile stdlib and init executable.
This commit is contained in:
14
SConstruct
14
SConstruct
@@ -11,30 +11,18 @@ AddOption(
|
||||
action = 'store',
|
||||
default = 'x86_64'
|
||||
)
|
||||
AddOption(
|
||||
'--target',
|
||||
dest = 'target',
|
||||
type = 'choice',
|
||||
choices = ('os', 'stdlib'),
|
||||
nargs = 1,
|
||||
action = 'store',
|
||||
default = 'os'
|
||||
)
|
||||
|
||||
arch = GetOption('arch')
|
||||
target = GetOption('target')
|
||||
|
||||
env = Environment(tools = ['default', 'compilation_db'], ENV = os.environ) # TODO inheriting the environment is not a best practice
|
||||
env.Append(CCFLAGS = ['-g', '-O0', '-fno-stack-protector'])
|
||||
env.Append(CPPDEFINES = ['BASTL_EXTENSIONS=1'])
|
||||
env['BUILD_TARGET'] = target
|
||||
env['TARGET_ARCH'] = arch
|
||||
# env.Append(CCFLAGS = ['-O2'])
|
||||
|
||||
env['ISO_FILES'] = []
|
||||
env = SConscript('targets/_any/SConscript', exports = 'env')
|
||||
if env['BUILD_TARGET'] == 'os':
|
||||
env = SConscript(f'targets/{arch}/SConscript', exports = 'env')
|
||||
env = SConscript(f'targets/{arch}/SConscript', exports = 'env')
|
||||
|
||||
comp_db = env.CompilationDatabase(target = '#compile_commands.json')
|
||||
env.Default(comp_db)
|
||||
|
||||
Reference in New Issue
Block a user