~tristan957/harvest-almanac

ref: bfe5e7751325f8d81c4689f3396f3f20a4ec6e37 harvest-almanac/harvest-glib/meson.build -rw-r--r-- 3.4 KiB
bfe5e775Tristan Partin flatpak: updated manifest file and docs 1 year, 10 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
harvest_glib_version = '1.0.0'

harvest_glib_config_h = configuration_data({
    'gettext_package': 'harvest-glib',
})

configure_file(
    input: 'config.h.in',
    output: 'config.h',
    configuration: harvest_glib_config_h,
)

harvest_glib_sources = [
    'harvest-api-client.c',
    'harvest-client.c',
    'harvest-common.c',
    'harvest-company.c',
    'harvest-creator.c',
    'harvest-estimate.c',
    'harvest-estimate-item-category.c',
    'harvest-estimate-line-item.c',
    'harvest-get-company-request.c',
    'harvest-invoice.c',
    'harvest-invoice-item-category.c',
    'harvest-invoice-line-item.c',
    'harvest-late-request.c',
    'harvest-links.c',
    'harvest-pageable.c',
    'harvest-paged.c',
    'harvest-project.c',
    'harvest-request.c',
    'harvest-response.c',
    'harvest-response-metadata.c',
    'harvest-task.c',
    'harvest-task-assignment.c',
    'harvest-time-entry.c',
    'harvest-user.c',
    'harvest-user-assignment.c',
    'harvest-users-me-request.c'
]

enums = gnome.mkenums_simple(
    'harvest-enum-types',
    sources: [
        'harvest-company.h',
        'harvest-estimate.h',
        'harvest-http.h',
        'harvest-invoice.h',
    ],
    install_header: true,
    header_prefix:
'''
#if !defined(__HARVEST_HEADER_INTERNAL__) && !defined(__HARVEST_COMPILATION__)
#	error "Only <harvest-glib/harvest.h> can be included directly."
#endif
''',
)

harvest_glib_public_headers = [
    'harvest.h',
    'harvest-api-client.h',
    'harvest-client.h',
    'harvest-common.h',
    'harvest-company.h',
    'harvest-creator.h',
    'harvest-estimate.h',
    'harvest-estimate-item-category.h',
    'harvest-estimate-line-item.h',
    'harvest-get-company-request.h',
    'harvest-http.h',
    'harvest-invoice.h',
    'harvest-invoice-item-category.h',
    'harvest-invoice-line-item.h',
    'harvest-late-request.h',
    'harvest-links.h',
    'harvest-pageable.h',
    'harvest-paged.h',
    'harvest-project.h',
    'harvest-request.h',
    'harvest-response.h',
    'harvest-response-metadata.h',
    'harvest-task.h',
    'harvest-task-assignment.h',
    'harvest-time-entry.h',
    'harvest-user.h',
    'harvest-user-assignment.h',
    'harvest-users-me-request.h',
]

install_headers(harvest_glib_public_headers, subdir: 'harvest-glib')

harvest_glib_c_args = [
    '-D__HARVEST_COMPILATION__',
]

if get_option('buildtype') == 'release'
    harvest_glib_c_args += [
        '-DG_DISABLE_ASSERT',
        '-DG_DISABLE_CHECKS',
        '-DG_DISABLE_CAST_CHECKS',
    ]
elif get_option('buildtype').startswith('debug')
    harvest_glib_c_args += [
        '-DG_ENABLE_DEBUG',
    ]
endif

harvest_glib_dependencies = [
    libgio_dep,
    json_glib_dep,
    libsoup_dep,
]

harvest_glib = library(
    'harvest-glib',
    harvest_glib_sources,
    enums,
    version: harvest_glib_version,
    c_args: harvest_glib_c_args,
    dependencies: harvest_glib_dependencies,
    install: true,
)

harvest_glib_dep = declare_dependency(
    include_directories: include_directories('..'),
    link_with: harvest_glib,
    version: harvest_glib_version,
)

if get_option('tests')
    subdir('tests')
endif

pkg.generate(
	harvest_glib,
	description: 'GLib-based library for interacting with the Harvest API.',
	filebase: 'harvest-glib-1.0',
	name: 'harvest-glib',
	version: harvest_glib_version,
    requires_private: [
        libgio_dep,
        json_glib_dep,
    ],
	url: 'https://git.sr.ht/~tristan957/harvest-almanac',
)