main wrapper
This commit is contained in:
40
meson.build
40
meson.build
@@ -187,20 +187,9 @@ else
|
||||
link += '-Wl,-export_dynamic'
|
||||
endif
|
||||
|
||||
cell_bin = executable('cell_bin', sources,
|
||||
dependencies: deps,
|
||||
include_directories: includers,
|
||||
link_args: link,
|
||||
build_rpath: '$ORIGIN',
|
||||
install: false
|
||||
)
|
||||
|
||||
cell_dep = declare_dependency(
|
||||
link_with: cell_bin
|
||||
)
|
||||
|
||||
cell_so = both_libraries(
|
||||
'cell',
|
||||
cell_so = shared_library(
|
||||
'cell_runtime',
|
||||
sources,
|
||||
include_directories: includers,
|
||||
dependencies: deps,
|
||||
@@ -215,9 +204,30 @@ qop_target = custom_target('core.qop',
|
||||
build_always_stale: true
|
||||
)
|
||||
|
||||
# Create final cell executable by appending core.zip to cell_bin
|
||||
# Determine RPATH based on OS
|
||||
# MacOS uses @loader_path, Linux uses $ORIGIN
|
||||
# We include both the current directory (for build) and ../lib (for install)
|
||||
rpath_dirs = []
|
||||
if host_machine.system() == 'darwin'
|
||||
rpath_dirs += ['@loader_path', '@loader_path/../lib']
|
||||
elif host_machine.system() == 'linux'
|
||||
rpath_dirs += ['$ORIGIN', '$ORIGIN/../lib']
|
||||
endif
|
||||
|
||||
# Create main executable linked against the cell library
|
||||
cell_exe = executable('cell_exe',
|
||||
'source/main.c',
|
||||
dependencies: deps,
|
||||
include_directories: includers,
|
||||
link_with: cell_so,
|
||||
link_args: link,
|
||||
build_rpath: ':'.join(rpath_dirs),
|
||||
install: false
|
||||
)
|
||||
|
||||
# Create final cell executable by appending core.zip to cell_exe
|
||||
cell = custom_target('cell',
|
||||
input: [cell_bin, qop_target],
|
||||
input: [cell_exe, qop_target],
|
||||
output: 'cell' + exe_ext,
|
||||
command: [
|
||||
'sh', '-c',
|
||||
|
||||
@@ -1239,7 +1239,7 @@ Shop.build_package = function(package)
|
||||
objs_str += '"$HERE/' + c_objects[i] + '" '
|
||||
}
|
||||
|
||||
var link_cmd = 'HERE=$(pwd); cd ' + module_dir + ' && cc ' + link_flags + ' ' + objs_str + ' -lcell -lc -lc++ -o ' + temp_lib
|
||||
var link_cmd = 'HERE=$(pwd); cd ' + module_dir + ' && cc ' + link_flags + ' ' + objs_str + ' -lcell_runtime -lc -lc++ -o ' + temp_lib
|
||||
var ret = os.system(link_cmd)
|
||||
if (ret != 0) {
|
||||
log.error("Linking failed")
|
||||
|
||||
@@ -460,7 +460,7 @@ static void signal_handler(int sig)
|
||||
exit_handler();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int cell_init(int argc, char **argv)
|
||||
{
|
||||
int profile_enabled = 0;
|
||||
int script_start = 1;
|
||||
|
||||
6
source/main.c
Normal file
6
source/main.c
Normal file
@@ -0,0 +1,6 @@
|
||||
extern int cell_init(int argc, char **argv);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
return cell_init(argc, argv);
|
||||
}
|
||||
Reference in New Issue
Block a user