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

Method get_cflags

test/common.py:897–916  ·  view source on GitHub ↗
(self, main_file=False, compile_only=False, asm_only=False)

Source from the content-addressed store, hash-verified

895 # (like --pre-js) do not need to be passed when building
896 # libraries, for example
897 def get_cflags(self, main_file=False, compile_only=False, asm_only=False):
898 def is_ldflag(f):
899 return f.startswith(('-l', '-sEXPORT_ES6', '-sGL_TESTING', '-sPROXY_TO_PTHREAD',
900 '-sENVIRONMENT=', '--pre-js=', '--post-js=', '-sPTHREAD_POOL_SIZE=',
901 '--profiling-funcs'))
902
903 args = self.serialize_settings(compile_only or asm_only) + self.cflags
904 if asm_only:
905 args = [a for a in args if not a.startswith('-O')]
906 if compile_only or asm_only:
907 args = [a for a in args if not is_ldflag(a)]
908 else:
909 args += self.ldflags
910 if not main_file:
911 for i, arg in enumerate(args):
912 if arg in {'--pre-js', '--post-js'}:
913 args[i] = None
914 args[i + 1] = None # noqa: B909
915 args = [arg for arg in args if arg is not None]
916 return args
917
918 def verify_es5(self, filename):
919 es_check = shared.get_npm_cmd('es-check')

Callers 15

output_nameMethod · 0.95
buildMethod · 0.95
get_libraryMethod · 0.95
emccMethod · 0.95
ccsharedMethod · 0.95
emscan-deps.pyFile · 0.45
mainFunction · 0.45
get_clang_commandFunction · 0.45
run_codesize_testMethod · 0.45
test_emcc_cflagsMethod · 0.45

Calls 1

serialize_settingsMethod · 0.95

Tested by 15

run_codesize_testMethod · 0.36
test_emcc_cflagsMethod · 0.36
test_emit_tsdMethod · 0.36
test_emit_tsd_heapMethod · 0.36
test_exit_runtimeMethod · 0.36