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 ' +
)
)
-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],
)