Added options to compile stdlib and init executable.

This commit is contained in:
2024-02-03 02:09:28 +01:00
parent c2a40a8104
commit 3ec4fa78b4
7 changed files with 66 additions and 35 deletions

View File

@@ -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)