diff options
author | Adam <adamdharrison@gmail.com> | 2023-06-19 13:50:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 13:50:41 -0400 |
commit | b7584e25f57bef9f41956b7d28e1edc1053e8f6a (patch) | |
tree | dc0de95488b15b9714d2a9247f25ec51a77ab127 /meson.build | |
parent | 8763e605d17f6d501af6b6e092ac28cb5d2dd4eb (diff) | |
parent | 6a426692def2da13fcc1159c8705e7455bb6f834 (diff) | |
download | lite-xl-plugin-manager-b7584e25f57bef9f41956b7d28e1edc1053e8f6a.tar.gz lite-xl-plugin-manager-b7584e25f57bef9f41956b7d28e1edc1053e8f6a.zip |
Merge pull request #24 from Jan200101/PR/meson
Add meson build system
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..b4a8a04 --- /dev/null +++ b/meson.build @@ -0,0 +1,58 @@ +project('lpm', + ['c'], + version : '1.0.4', + license : 'LPM', + meson_version : '>= 0.56', +) + +cc = meson.get_compiler('c') + +zlib_dep = dependency('zlib') +mbedtls_dep = dependency('mbedtls', required: false) +libgit2_dep = dependency('libgit2') +libzip_dep = dependency('libzip') +lua_dep = dependency('lua') +microtar_dep = dependency('microtar', required: false) + +if not mbedtls_dep.found() + mbedtls_dep = [ + cc.find_library('mbedtls'), + cc.find_library('mbedx509'), + cc.find_library('mbedcrypto'), + ] +endif + +if not microtar_dep.found() + microtar_lib = static_library('microtar', files('lib/microtar/src/microtar.c')) + + microtar_dep = declare_dependency( + link_whole: [microtar_lib], + include_directories: ['lib/microtar/src'] + ) + + message('Using git module for microtar') +endif + +lpm_source = files('src/lpm.c') +cargs = [] +if get_option('static') + lua_exe = find_program('lua') + xxd_exe = find_program('xxd') + + lpm_luac = configure_file( + capture: false, + command: [lua_exe, '-e', 'io.open("@OUTPUT0@", "wb"):write(string.dump(assert(loadfile("@INPUT0@"))))'], + 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' + ) + +endif + +executable('lpm', lpm_source, dependencies: [zlib_dep, mbedtls_dep, libgit2_dep, libzip_dep, lua_dep, microtar_dep])
\ No newline at end of file |