~aperezdc/kiln

31b9b2b2c6b6c4e881c722b80f27260afa82bca5 — Adrian Perez de Castro 4 years ago b0e8e3c
meson: Add minimal setup for running HotDoc
6 files changed, 60 insertions(+), 5 deletions(-)

A doc/index.md
A doc/sitemap.txt
M libkn/kiln-loader.c
M libkn/meson.build
M meson.build
M meson_options.txt
A doc/index.md => doc/index.md +0 -0
A doc/sitemap.txt => doc/sitemap.txt +2 -0
@@ 0,0 1,2 @@
index.md
	c-index

M libkn/kiln-loader.c => libkn/kiln-loader.c +3 -3
@@ 371,7 371,7 @@ kiln_loader_prepend_path (KilnLoader *self,
 * @module_name: Name of the module to find
 * @error: (nullable): Location where to store an error, if any
 *
 * If the module cannot be found, %NULL is returned and @error will be filled
 * If the module cannot be found, @NULL is returned and @error will be filled
 * in, if provided.
 *
 * Returns: (transfer none): A #KilnModule.


@@ 454,7 454,7 @@ kiln_loader_find_module (KilnLoader *self,
 * @error: (nullable): Location where to store an error, if any.
 *
 * Finds and loads a module given its name. If the module cannot be found or
 * loaded, %NULL is returned and @error will be filled in, if provided.
 * loaded, @NULL is returned and @error will be filled in, if provided.
 *
 * Returns: (transfer full): The #JSCValue returned by the module
 *    initialization function.


@@ 485,7 485,7 @@ kiln_loader_load_module (KilnLoader *self,
 * using kiln_loader_load_module() and then assigning the returned #JSCValue
 * in the #JSCContext's global object to @module_name. If the module cannot
 * be found, loaded, or a value named @module_name is already present in the
 * #JSCContext, then %FALSE is returned and @error will be filled in, if
 * #JSCContext, then @FALSE is returned and @error will be filled in, if
 * provided.
 *
 * Returns: Whether the module was opened.

M libkn/meson.build => libkn/meson.build +11 -2
@@ 4,10 4,19 @@ libkn_dependencies = [
	javascriptcore_dep,
]

libkn = library('kiln',
libkn_sources = files(
	'kiln-loader.c',
	build_by_default: false,
)
libkn_headers = files(
	'kiln.h',
	'kiln-loader.h',
)

libkn = library('kiln',
	libkn_sources,
	libkn_headers,
	dependencies: libkn_dependencies,
	build_by_default: false,
)

libkn_dep = declare_dependency(

M meson.build => meson.build +39 -0
@@ 34,3 34,42 @@ subdir('libkn')
subdir('modules')
subdir('wkext', if_found: webkit_extension_dep)
subdir('shell', if_found: javascriptcore_dep)

documentation_option = get_option('documentation')
hotdoc_has_c_extension = false
if documentation_option.enabled() or documentation_option.auto()
	hotdoc = import('hotdoc')
	hotdoc_has_c_extension = hotdoc.has_extensions('c-extension')
	hotdoc_has_devhelp_extension = hotdoc.has_extensions('devhelp-extension')
endif

build_documentation = false
if documentation_option.auto()
	build_documentation = hotdoc_has_c_extension
elif documentation_option.enabled()
	assert(hotdoc_has_c_extension, 'The HotDoc C extension is required.')
	build_documentation = true
endif

if build_documentation
	kiln_doc = hotdoc.generate_doc(meson.project_name(),
		project_version: meson.project_version(),
		sitemap: 'doc/sitemap.txt',
		index: 'doc/index.md',
		console: true,
		install: false,
		build_by_default: true,
		c_smart_index: true,
		c_sources: [
			libkn_sources,
			libkn_headers,
		],
		c_include_directories: [
		],
		dependencies: [
			libkn_dep,
		],
		devhelp_activate: hotdoc_has_devhelp_extension,
		verbose: true,
	)
endif

M meson_options.txt => meson_options.txt +5 -0
@@ 11,3 11,8 @@ option('jsc_shell',
	type: 'feature',
	description: 'Build JavaScriptCore CLI shell with module loader'
)
option('documentation',
	type: 'feature',
	value: 'auto',
	description: 'Build reference documentation (needs HotDoc)'
)