~tristan957/harvest-almanac

712f6530d46b1eb6e15e8acc62bbdbf8790a8d95 — Tristan Partin 1 year, 9 months ago d63eace
meson: fixed test and added include guard to generated enums file
2 files changed, 14 insertions(+), 2 deletions(-)

M harvest-glib/meson.build
M harvest-glib/tests/meson.build
M harvest-glib/meson.build => harvest-glib/meson.build +7 -1
@@ 48,6 48,12 @@ enums = gnome.mkenums_simple(
        '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 = [


@@ 118,7 124,7 @@ harvest_glib = library(
harvest_glib_dep = declare_dependency(
    include_directories: include_directories('..'),
    link_with: harvest_glib,
    version: harvest_glib_version
    version: harvest_glib_version,
)

if get_option('with-tests')

M harvest-glib/tests/meson.build => harvest-glib/tests/meson.build +7 -1
@@ 13,12 13,18 @@ test_env = environment()
test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())

c_args = [
	'-D__HARVEST_COMPILATION__'
]

foreach test_name, value : harvest_tests
	exe = executable(
		test_name,
		test_name + '.c',
		enums,
		dependencies: dependencies,
		include_directories: include_directories('..')
		include_directories: include_directories('..'),
		c_args: c_args,
	)

	test(test_name, exe, env: test_env)