MCPcopy Create free account
hub / github.com/cztomczak/cefpython / build_library

Function build_library

tools/build_cpp_projects.py:125–149  ·  view source on GitHub ↗
(lib_name, macros, output_dir,
                  sources=None, sources_dir=None)

Source from the content-addressed store, hash-verified

123
124
125def build_library(lib_name, macros, output_dir,
126 sources=None, sources_dir=None):
127 assert bool(sources_dir) ^ bool(sources) # xor
128 print("[build_cpp_projects.py] Build library: {lib_name}"
129 .format(lib_name=lib_name))
130 compiler = get_compiler()
131 if not os.path.exists(output_dir):
132 os.makedirs(output_dir)
133 if sources_dir:
134 assert not sources
135 sources = get_sources(sources_dir)
136 (changed, objects) = smart_compile(compiler,
137 macros=macros,
138 extra_args=COMPILER_ARGS,
139 sources=sources,
140 output_dir=output_dir)
141 lib_path = os.path.join(output_dir, lib_name + LIB_EXT)
142 if changed or not os.path.exists(lib_path):
143 compiler.create_static_lib(objects, lib_name,
144 output_dir=output_dir)
145 print("[build_cpp_projects.py] Created library: {lib_name}"
146 .format(lib_name=lib_name))
147 else:
148 print("[build_cpp_projects.py] Library is up-to-date: {lib_name}"
149 .format(lib_name=lib_name))
150
151
152def build_cefpython_app_library():

Callers 2

mainFunction · 0.85

Calls 3

get_compilerFunction · 0.85
get_sourcesFunction · 0.85
smart_compileFunction · 0.85

Tested by

no test coverage detected