(lib_name, macros, output_dir,
sources=None, sources_dir=None)
| 123 | |
| 124 | |
| 125 | def 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 | |
| 152 | def build_cefpython_app_library(): |
no test coverage detected