log available
This commit is contained in:
16
build.cm
16
build.cm
@@ -260,11 +260,12 @@ Build.build_module_dylib = function(pkg, file, target, opts) {
|
||||
var build_dir = get_build_dir()
|
||||
ensure_dir(build_dir)
|
||||
var dylib_path = build_dir + '/' + link_key + '.' + _target + dylib_ext
|
||||
var cmd_parts = null
|
||||
var cmd_str = null
|
||||
var ret = null
|
||||
|
||||
if (fd.is_file(dylib_path))
|
||||
return dylib_path
|
||||
|
||||
var cmd_parts = [cc, '-shared', '-fPIC']
|
||||
if (!fd.is_file(dylib_path)) {
|
||||
cmd_parts = [cc, '-shared', '-fPIC']
|
||||
|
||||
if (tc.system == 'darwin') {
|
||||
cmd_parts = array(cmd_parts, [
|
||||
@@ -294,14 +295,15 @@ Build.build_module_dylib = function(pkg, file, target, opts) {
|
||||
push(cmd_parts, '-o')
|
||||
push(cmd_parts, '"' + dylib_path + '"')
|
||||
|
||||
var cmd_str = text(cmd_parts, ' ')
|
||||
cmd_str = text(cmd_parts, ' ')
|
||||
log.console('Linking module ' + file + ' -> ' + fd.basename(dylib_path))
|
||||
var ret = os.system(cmd_str)
|
||||
ret = os.system(cmd_str)
|
||||
if (ret != 0) {
|
||||
print('Linking failed: ' + file); disrupt
|
||||
}
|
||||
}
|
||||
|
||||
// Install to deterministic lib/<pkg>/<stem>.dylib
|
||||
// Always install to deterministic lib/<pkg>/<stem>.dylib
|
||||
// Strip .c/.cpp extension so the loader can find it by module name
|
||||
var file_stem = file
|
||||
if (ends_with(file_stem, '.cpp')) file_stem = text(file_stem, 0, -4)
|
||||
|
||||
@@ -382,6 +382,7 @@ os.run_ast_fn = run_ast_fn
|
||||
os.run_ast_noopt_fn = run_ast_noopt_fn
|
||||
core_extras.core_json = json
|
||||
core_extras.actor_api = $_
|
||||
core_extras.log = log
|
||||
core_extras.runtime_env = runtime_env
|
||||
core_extras.content_hash = content_hash
|
||||
core_extras.cache_path = cache_path
|
||||
|
||||
Reference in New Issue
Block a user