From ca856d55faf8501d90122a72e42cf3260dbadfb6 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 27 Jan 2023 12:48:12 +0100 Subject: [PATCH] :art: add standalone cap to config --- Makefile | 2 +- scripts/embed.bash | 4 ++++ src/arg.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f91c102c..65352573 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ options-show: with_config: bash scripts/embed.bash gwion.config.json touch src/main.c - USE_CONFIG=1 CFLAGS="-DGWION_EMBED_GW -Iembed $(eval ${CFLAGS})" ${MAKE} + ${MAKE} USE_CONFIG=1 touch src/main.c almost_gwion: ${almost_obj} ${ALMOST_LIBS} diff --git a/scripts/embed.bash b/scripts/embed.bash index bad1b1b2..6def47f6 100644 --- a/scripts/embed.bash +++ b/scripts/embed.bash @@ -182,3 +182,7 @@ ldflags=$(jq -rc '.ldflags' <<< "$json") echo "LDFLAGS += $ldflag " done } >> embed/embed.mk +standalone=$(jq -rc '.standalone' <<< "$json") +[ "$standalone" = "true" ] && { + echo "CFLAGS += -DGWION_STANDALONE" +} >> embed/embed.mk diff --git a/src/arg.c b/src/arg.c index 13c7408b..1c1a7e73 100644 --- a/src/arg.c +++ b/src/arg.c @@ -73,7 +73,9 @@ ANN static void arg_init(CliArg *arg) { vector_init(&arg->add); vector_init(&arg->lib); vector_init(&arg->config); +#ifndef GWION_STANDALONE vector_add(&arg->lib, (vtype)plug_dir()); +#endif arg->color = COLOR_AUTO; } @@ -386,6 +388,8 @@ ANN m_bool arg_parse(const Gwion gwion, CliArg *a) { #ifdef __FUZZING return; #endif +#ifndef GWION_STANDALONE config_default(&arg); +#endif return _arg_parse(&arg); } -- 2.43.0