From a7a569ce5f6d6d0c48a43b766a283beec7fa2f02 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Tue, 20 Jun 2023 11:01:20 -0400 Subject: Removed xxd as a dependnecy. --- meson.build | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index b4a8a04..32664cc 100644 --- a/meson.build +++ b/meson.build @@ -34,25 +34,17 @@ if not microtar_dep.found() endif lpm_source = files('src/lpm.c') -cargs = [] +cflags = [] if get_option('static') lua_exe = find_program('lua') - xxd_exe = find_program('xxd') - lpm_luac = configure_file( + lpm_source += configure_file( capture: false, - command: [lua_exe, '-e', 'io.open("@OUTPUT0@", "wb"):write(string.dump(assert(loadfile("@INPUT0@"))))'], + command: [lua_exe, '-e', 'f = string.dump(assert(loadfile("@INPUT0@"))) io.open("@OUTPUT0@", "wb"):write("unsigned char lpm_luac[] = \"" .. f:gsub(".", function (c) return string.format("\\\x%02X",string.byte(c)) end) .. "\";unsigned int lpm_luac_len = " .. #f .. ";")'], input: files('src/lpm.lua'), - output: 'lpm.luac' - ) - - lpm_source += configure_file( - capture: true, - command: [xxd_exe, '-i', '@INPUT@'], - input: lpm_luac, output: 'lpm.lua.c' ) - + cflags += '-DLPM_STATIC' endif -executable('lpm', lpm_source, dependencies: [zlib_dep, mbedtls_dep, libgit2_dep, libzip_dep, lua_dep, microtar_dep]) \ No newline at end of file +executable('lpm', lpm_source, dependencies: [zlib_dep, mbedtls_dep, libgit2_dep, libzip_dep, lua_dep, microtar_dep], c_args: cflags) -- cgit v1.2.3