def nasm_sources(target: str): if target.startswith('x86_64'): return ["nasmsrc.asm"] return ["fallback.c"] def nasm_defines(target: str): if target.startswith('x86_64') and ('-windows-' in target or target.endswith('-windows')): return ['WIN64'] return [] nasmobjs = add_object_library( name = "nasmobjs", sources = [], include_dirs_public = ["."], generator_vars = lambda ctx: generator_vars( sources = nasm_sources(ctx.c_compiler.target_triple), defines = nasm_defines(ctx.c_compiler.target_triple), ), )