From 8f961ed25d1f13221111e23c2aff47882653b205 Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Mon, 28 Aug 2023 23:28:15 +0200 Subject: [PATCH] Meson: Conditionally generate apidocfiles.h --- meson.build | 8 -------- pdns/meson.build | 31 +++++++++++++++++-------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/meson.build b/meson.build index 657c2d3607..d748666693 100644 --- a/meson.build +++ b/meson.build @@ -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 ' + diff --git a/pdns/meson.build b/pdns/meson.build index b0a4716a71..3e6ec3fd30 100644 --- a/pdns/meson.build +++ b/pdns/meson.build @@ -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], ) -- 2.47.2