~lattis/muon

ref: 6e13d4e257bf32fa8665702ce01eb4d51b56e8bd muon/src/functions/modules/pkgconfig.c -rw-r--r-- 1.9 KiB
6e13d4e2Stone Tickle absolutize first element of custom target cmdline 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "posix.h"

#include "functions/modules/pkgconfig.h"

static bool
func_module_pkgconfig_generate(struct workspace *wk, obj rcvr, uint32_t args_node, obj *obj)
{
	struct args_norm ao[] = { { obj_build_target }, ARG_TYPE_NULL };
	enum kwargs {
		kw_description,
		kw_extra_cflags,
		kw_filebase,
		kw_install_dir,
		kw_libraries,
		kw_libraries_private,
		kw_name,
		kw_subdirs,
		kw_requires,
		kw_requires_private,
		kw_url,
		kw_variables,
		kw_unescaped_variables,
		kw_uninstalled_variables,
		kw_unescaped_uninstalled_variables,
		kw_version,
		kw_dataonly,
		kw_conflicts,
	};
	struct args_kw akw[] = {
		[kw_description] = { "description", obj_string },
		[kw_extra_cflags] = { "extra_cflags", ARG_TYPE_ARRAY_OF | obj_string },
		[kw_filebase] = { "filebase", obj_string },
		[kw_install_dir] = { "install_dir", obj_string },
		[kw_libraries] = { "libraries", ARG_TYPE_ARRAY_OF | obj_any },
		[kw_libraries_private] = { "libraries_private", ARG_TYPE_ARRAY_OF | obj_any },
		[kw_name] = { "name", obj_string },
		[kw_subdirs] = { "subdirs", ARG_TYPE_ARRAY_OF | obj_string },
		[kw_requires] = { "requires", ARG_TYPE_ARRAY_OF | obj_string },
		[kw_requires_private] = { "requires_private", ARG_TYPE_ARRAY_OF | obj_string },
		[kw_url] = { "url", obj_string },
		[kw_variables] = { "variables", obj_any },
		[kw_unescaped_variables] = { "unescaped_variables", obj_any },
		[kw_uninstalled_variables] = { "uninstalled_variables", obj_any },
		[kw_unescaped_uninstalled_variables] = { "unescaped_uninstalled_variables", obj_any },
		[kw_version] = { "version", obj_string },
		[kw_dataonly] = { "dataonly", obj_bool },
		[kw_conflicts] = { "conflicts", ARG_TYPE_ARRAY_OF | obj_string },
		0
	};
	if (!interp_args(wk, args_node, NULL, ao, akw)) {
		return false;
	}

	return true;
}
const struct func_impl_name impl_tbl_module_pkgconfig[] = {
	{ "generate", func_module_pkgconfig_generate },
	{ NULL, NULL },
};