Browse Source

Asan support for bootstrap build

default_compile_flags
vector-of-bool 5 years ago
parent
commit
3d961908aa
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      tools/build.py

+ 7
- 0
tools/build.py View File

jobs: int jobs: int
static: bool static: bool
debug: bool debug: bool
asan: bool


@property @property
def is_msvc(self) -> bool: def is_msvc(self) -> bool:
str(cpp_file), str(cpp_file),
f'-o{obj_file}', f'-o{obj_file}',
] ]
if opts.asan:
cmd.append('-fsanitize=address')
if have_ccache(): if have_ccache():
cmd.insert(0, 'ccache') cmd.insert(0, 'ccache')
elif have_sccache(): elif have_sccache():
'-lstdc++fs', '-lstdc++fs',
f'-o{out}', f'-o{out}',
] ]
if opts.asan:
cmd.append('-fsanitize=address')
if opts.static: if opts.static:
cmd.extend(( cmd.extend((
'-static', '-static',
help='Build with debug information and disable optimizations') help='Build with debug information and disable optimizations')
parser.add_argument( parser.add_argument(
'--static', action='store_true', help='Build a static executable') '--static', action='store_true', help='Build a static executable')
parser.add_argument('--asan', action='store_true', help='Enable Address Sanitizer')
args = parser.parse_args(argv) args = parser.parse_args(argv)


all_sources = set(ROOT.glob('src/**/*.cpp')) all_sources = set(ROOT.glob('src/**/*.cpp'))
cxx=Path(args.cxx), cxx=Path(args.cxx),
jobs=args.jobs, jobs=args.jobs,
static=args.static, static=args.static,
asan=args.asan,
debug=args.debug) debug=args.debug)


objects = compile_sources(build_opts, sorted(all_sources)) objects = compile_sources(build_opts, sorted(all_sources))

Loading…
Cancel
Save