]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Conditionally generate apidocfiles.h
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 28 Aug 2023 21:28:15 +0000 (23:28 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:48 +0000 (13:28 +0100)
meson.build
pdns/meson.build

index 657c2d360737124dd62013980b8dc5728672d528..d7486666937ee00db135695028e0bbc08e716daa 100644 (file)
@@ -82,14 +82,6 @@ subdir('meson' / 'socket-dir')              # Socket Dir
 subdir('meson' / 'various-functions')       # Various Functions
 subdir('meson' / 'various-headers')         # Various Headers
 
-# Swagger
-# if not fs.exists('pdns' / 'api-swagger.json') and not python_have_venv
-#   error('Python3 and/or its venv module is not available and ' +
-#         '`pdns/api-swagger.json` cannot be found. ' +
-#         'The Authoritative Server cannot be built.')
-# endif
-# TODO Generate api-swagger.json
-
 # Manpages
 # if not fs.exists('docs' / 'pdns_server.1') and not python_have_venv
 #   warning('Python3 and/or its venv module is not available and ' +
index b0a4716a712c3ec796515f68ba444c65a9cf463e..3e6ec3fd304d0cbd6d1d2ad9e77613cc1721c17f 100644 (file)
@@ -242,20 +242,23 @@ libpdns = declare_dependency(
   )
 )
 
-libpdns_auth_api_swagger = custom_target(
-  'libpdns-auth-api-swagger',
-  command: [
-    python_prog,
-    '@INPUT0@',
-    '@INPUT1@',
-  ],
-  input: [
-    'generate-api-swagger.py',
-    product_source_dir / 'docs' / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml',
-  ],
-  output: 'apidocfiles.h',
-  capture: true,
-)
+libpdns_auth_api_swagger = 'apidocfiles.h'
+if not fs.is_file('apidocfiles.h')
+  libpdns_auth_api_swagger = custom_target(
+    'libpdns-auth-api-swagger',
+    command: [
+      python_prog,
+      '@INPUT0@',
+      '@INPUT1@',
+    ],
+    input: [
+      'generate-api-swagger.py',
+      product_source_dir / 'docs' / 'http-api' / 'swagger' / 'authoritative-api-swagger.yaml',
+    ],
+    output: 'apidocfiles.h',
+    capture: true,
+  )
+endif
 libpdns_auth_api_swagger = declare_dependency(
   sources: [libpdns_auth_api_swagger],
 )