]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Ragel generator
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 8 Aug 2023 13:51:42 +0000 (15:51 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:34 +0000 (13:28 +0100)
meson.build
meson/prog-ragel/meson.build [deleted file]
meson/ragel/meson.build [new file with mode: 0644]

index 2e67e80adeecfc99048b0c38790f60da9bd82658..1841b26cd8815ba8a7846e8f12a4be25cbeb4377 100644 (file)
@@ -51,7 +51,7 @@ subdir('meson' / 'libssl')                 # OpenSSL libssl
 subdir('meson' / 'gnutls')                 # GnuTLS
 subdir('meson' / 'dot')                    # DNS over TLS
 subdir('meson' / 'ipcipher')               # IPCipher
-subdir('meson' / 'prog-ragel')             # Find Ragel
+subdir('meson' / 'ragel')                  # Find Ragel and create generator
 subdir('meson' / 'clock-gettime')          # Clock_gettime
 subdir('meson' / 'boost')                  # Boost
 subdir('meson' / 'boost-program-options')  # Boost Program Options Library
@@ -72,12 +72,11 @@ subdir('meson' / 'auto-var-init')          # Automatic Variable Initialization
 subdir('meson' / 'sanitizers')             # Sanitizers
 subdir('meson' / 'malloc-trace')           # Malloc-trace
 
-# Find or generate pdns/dnslabeltext.cc
-if not ragel.found() and not fs.exists('pdns/dnslabeltext.cc')
+# Find ragel or pdns/dnslabeltext.cc
+if not ragel.found() and not fs.exists('pdns' / 'dnslabeltext.cc')
   error('Ragel is missing and `pdns/dnslabeltext.cc` cannot be found. ' +
         'Install Ragel or download the sources from www.powerdns.com')
 endif
-# TODO Generate pdns/dnslabeltext.cc
 
 # Backend Unit Tests
 opt_backend_unittests = get_option('unit-tests-backends')
diff --git a/meson/prog-ragel/meson.build b/meson/prog-ragel/meson.build
deleted file mode 100644 (file)
index 09d0b2e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Find Ragel
-# Outputs: ragel
-
-ragel = find_program('ragel', required: false)
-
-summary('Ragel', ragel.found(), bool_yn: ragel.found(), section: 'Programs')
diff --git a/meson/ragel/meson.build b/meson/ragel/meson.build
new file mode 100644 (file)
index 0000000..1ce6d8a
--- /dev/null
@@ -0,0 +1,13 @@
+# Find Ragel and create generator
+# Outputs: ragel
+
+ragel = find_program('ragel', required: false)
+summary('Ragel', ragel.found(), bool_yn: ragel.found(), section: 'Programs')
+# summary('Ragel', ragel.full_path(), section: 'System')       # TODO Meson 0.55
+# summary('Ragel Version', ragel.version(), section: 'System') # TODO Meson 0.62
+
+ragel_generator = generator(
+  ragel,
+  output: '@BASENAME@.cc',
+  arguments: ['@INPUT@', '-o', '@OUTPUT@'],
+)