builds urbit-worker separately from urbit

This commit is contained in:
Joe Bryan 2018-12-17 12:30:02 -05:00
parent 81d6570410
commit 3137fc3b87
6 changed files with 11 additions and 33 deletions

View File

@ -1210,12 +1210,6 @@
void
u3_newt_read(u3_moat* mot_u);
/** Main for worker process.
**/
c3_i
u3_serf_main(c3_i arg_i,
c3_c** arg_c);
/** Pier control.
**/
/* u3_pier_create(): create a pier, loading existing.

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
if ! [[ -f $MESON_BUILD_ROOT/urbit-worker ]]; then
ln -s $MESON_BUILD_ROOT/urbit $MESON_BUILD_ROOT/urbit-worker
fi

View File

@ -222,7 +222,6 @@ vere_lib_src = [
'vere/pier.c',
'vere/reck.c',
'vere/save.c',
'vere/serf.c',
'vere/term.c',
'vere/time.c',
'vere/unix.c',
@ -367,10 +366,14 @@ dependencies: vere_deps + os_deps,
link_with: libnoun,
install: true)
# XX remove once urbit-worker is a separate executable
# XX add similar workaround for install
#
run_target('worker', command: 'meson-scripts/make-worker.sh')
executable('urbit-worker',
sources : vere_lib_src + [ 'vere/serf.c' ],
include_directories : incdir,
c_args : os_c_flags,
link_args: os_link_flags,
dependencies: vere_deps + os_deps,
link_with: libnoun,
install: true)
test_hashtable = executable('test-hashtable',
sources : vere_lib_src + ['tests/hashtable_tests.c'],

View File

@ -2,4 +2,4 @@
mkdir ./build &> /dev/null
meson . ./build --buildtype=release "$@"
ninja -C build urbit && ninja -C build worker
ninja -C build

View File

@ -518,20 +518,6 @@ c3_i
main(c3_i argc,
c3_c** argv)
{
// Detect executable purpose.
//
{
c3_c* nam_c = strrchr(argv[0], '/');
if ( !nam_c )
nam_c = argv[0];
else nam_c++;
if ( !strcmp("urbit-worker", nam_c) ) {
return u3_serf_main(argc, argv);
}
}
// Parse options.
//
if ( c3n == _main_getopt(argc, argv) ) {

View File

@ -406,10 +406,10 @@ u3_serf_boot(void)
_serf_send(u3nc(c3__play, dat));
}
/* u3_serf_main(): main() when run as urbit-client
/* main(): main() when run as urbit-worker
*/
c3_i
u3_serf_main(c3_i argc, c3_c* argv[])
main(c3_i argc, c3_c* argv[])
{
uv_loop_t* lup_u = uv_default_loop();
c3_c* dir_c = argv[1];