MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / get_base_cflags

Function get_base_cflags

tools/system_libs.py:60–82  ·  view source on GitHub ↗
(build_dir, force_object_files=False, preprocess=True)

Source from the content-addressed store, hash-verified

58
59
60def get_base_cflags(build_dir, force_object_files=False, preprocess=True):
61 # Always build system libraries with debug information. Non-debug builds
62 # will ignore this at link time because we link with `-strip-debug`.
63 flags = ['-g', '-sSTRICT', '-Werror']
64 if settings.LTO and not force_object_files:
65 flags += ['-flto=' + settings.LTO]
66 if settings.MAIN_MODULE or settings.SIDE_MODULE:
67 # Explicitly include `-sMAIN_MODULE` when building system libraries.
68 # `-fPIC` alone is not enough to configure trigger the building and
69 # caching of `pic` libraries (see `get_lib_dir` in `cache.py`)
70 # FIXME(sbc): `-fPIC` should really be enough here.
71 flags += ['-fPIC', '-sMAIN_MODULE']
72 if preprocess:
73 flags += ['-DEMSCRIPTEN_DYNAMIC_LINKING']
74 if settings.MEMORY64:
75 flags += ['-m64']
76
77 source_dir = utils.path_from_root()
78 relative_source_dir = os.path.relpath(source_dir, build_dir)
79 flags += [f'-ffile-prefix-map={source_dir}={DETERMINISTIC_PREFIX}',
80 f'-ffile-prefix-map={relative_source_dir}={DETERMINISTIC_PREFIX}',
81 f'-fdebug-compilation-dir={DETERMINISTIC_PREFIX}']
82 return flags
83
84
85def get_build_dir():

Callers 3

generate_ninjaMethod · 0.85
build_objectsMethod · 0.85
get_cflagsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected