aboutsummaryrefslogtreecommitdiff
path: root/lpg/subprojects/packagefiles/lua-5.4.7/meson.build
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2025-01-08 10:54:40 +0100
committerPřemysl Eric Janouch <p@janouch.name>2025-01-11 09:57:59 +0100
commit7aa1e5dd3d80e2664eac7eb0a409829e9785a521 (patch)
treec986a85bce91de498c7470a87da209700dc081ff /lpg/subprojects/packagefiles/lua-5.4.7/meson.build
parent9319d14566e5d1bfec617c479b8543a9ee3ad4ea (diff)
downloadpdf-simple-sign-lpg-libqr.tar.gz
pdf-simple-sign-lpg-libqr.tar.xz
pdf-simple-sign-lpg-libqr.zip
WIP: Add a Lua PDF generatorlpg-libqr
Because Lua compiled for C++ might be hard to find, provide a wrap. Only GitHub releases seem to contain onelua.c, which is a very handy file. WIP: Add documentation, actually get rid of the libqr copy.
Diffstat (limited to 'lpg/subprojects/packagefiles/lua-5.4.7/meson.build')
-rw-r--r--lpg/subprojects/packagefiles/lua-5.4.7/meson.build50
1 files changed, 50 insertions, 0 deletions
diff --git a/lpg/subprojects/packagefiles/lua-5.4.7/meson.build b/lpg/subprojects/packagefiles/lua-5.4.7/meson.build
new file mode 100644
index 0000000..dbc8ff6
--- /dev/null
+++ b/lpg/subprojects/packagefiles/lua-5.4.7/meson.build
@@ -0,0 +1,50 @@
+project(
+ 'lua-5.4',
+ 'cpp',
+ license : 'MIT',
+ meson_version : '>=0.49.2',
+ version : '5.4.7',
+ default_options : ['c_std=c99', 'warning_level=2'],
+)
+
+cxx = meson.get_compiler('cpp')
+
+# Skip bogus warning.
+add_project_arguments(cxx.get_supported_arguments(
+ '-Wno-string-plus-int', '-Wno-stringop-overflow'), language : 'cpp')
+
+# Platform-specific defines.
+is_posix = host_machine.system() in ['cygwin', 'darwin', 'dragonfly', 'freebsd',
+ 'gnu', 'haiku', 'linux', 'netbsd', 'openbsd', 'sunos']
+if is_posix
+ add_project_arguments('-DLUA_USE_POSIX', language : 'cpp')
+endif
+
+# Library dependencies.
+lua_lib_deps = [cxx.find_library('m', required : false)]
+
+if meson.version().version_compare('>= 0.62')
+ dl_dep = dependency('dl', required : get_option('loadlib'))
+else
+ dl_dep = cxx.find_library('dl', required : get_option('loadlib'))
+endif
+
+if dl_dep.found()
+ lua_lib_deps += dl_dep
+ add_project_arguments('-DLUA_USE_DLOPEN', language : 'cpp')
+endif
+
+# Targets.
+add_project_arguments('-DMAKE_LIB', language : 'cpp')
+lua_lib = static_library(
+ 'lua',
+ 'onelua.cpp',
+ dependencies : lua_lib_deps,
+ implicit_include_directories : false,
+)
+
+inc = include_directories('.')
+lua_dep = declare_dependency(
+ link_with : lua_lib,
+ include_directories : inc,
+)