From: Fred Morcos Date: Mon, 28 Aug 2023 21:28:15 +0000 (+0200) Subject: Meson: Conditionally generate apidocfiles.h X-Git-Tag: rec-5.1.0-alpha1~80^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f961ed25d1f13221111e23c2aff47882653b205;p=thirdparty%2Fpdns.git Meson: Conditionally generate apidocfiles.h --- 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], )