From 4895f276464da4648366149741779533994c7129 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Sun, 15 Dec 2024 21:22:47 +0800 Subject: [PATCH] meson: provide CFLAGS and LDFLAGS --- src/api/system.c | 8 ++++++++ src/meson.build | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/api/system.c b/src/api/system.c index 64d67813c..1b5ec1a9e 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -1359,6 +1359,14 @@ static int f_get_debug_info(lua_State *L) { lua_pushboolean(L, 0); #endif lua_setfield(L, -2, "renderer"); +#ifdef LITE_BUILD_CARGS + lua_pushstring(L, LITE_BUILD_CARGS); + lua_setfield(L, -2, "CFLAGS"); +#endif +#ifdef LITE_LINK_ARGS + lua_pushstring(L, LITE_LINK_ARGS); + lua_setfield(L, -2, "LDFLAGS"); +#endif return 1; } diff --git a/src/meson.build b/src/meson.build index bcb19a19a..114c99fc3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -67,6 +67,11 @@ elif host_machine.system() == 'darwin' endif lite_includes += include_directories('.') +c_conf_data = configuration_data() +c_conf_data.set_quoted('cargs', ' '.join(lite_cargs).replace('"', '\'')) +c_conf_data.set_quoted('link_args', ' '.join(lite_link_args).replace('"', '\'')) +lite_cargs += '-DLITE_BUILD_CARGS=' + c_conf_data.get('cargs') +lite_cargs += '-DLITE_LINK_ARGS=' + c_conf_data.get('link_args') executable('lite-xl', lite_sources + lite_rc,