From 9c053ec1b1c7cd91ca6c0cc6f65803cc3f114c7f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 27 Mar 2020 16:58:18 +0200 Subject: Add namespace to format rcc: - add -n/--namespace to command line - make default compression None - fix None compression not printing hexdumps libembed: - add a zstd decompression test --- meson.build | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index ffae406..f0f8194 100644 --- a/meson.build +++ b/meson.build @@ -6,32 +6,40 @@ project('libembed', ['cpp'], add_project_arguments(['-stdlib=libc++'], language: 'cpp') add_project_link_arguments(['-stdlib=libc++'], language : 'cpp') -dep_zstd = dependency('libzstd') -dep_gtest = dependency('gtest') +libzstd = dependency('libzstd') + +libembed_sourceset = import('sourceset').source_set() +libembed_sourceset.add(files('lib/embed.cpp')) +libembed_sourceset.add(when: libzstd, if_true: [ libzstd, files('lib/embed_zstd.cpp') ] ) +libembed_conf = libembed_sourceset.apply(configuration_data()) libembed = library('embed', - 'lib/embed.cpp', - dependencies: [ dep_zstd ], + libembed_conf.sources(), + dependencies: libembed_conf.dependencies(), include_directories: '3rd-party/frozen/include/' ) -dep_libembed = declare_dependency( +dep_embed = declare_dependency( link_with: libembed, include_directories: include_directories('lib/', '3rd-party/frozen/include') ) prog_python = import('python').find_installation('python3') + resources_h = custom_target('resources.h', output: 'resources.h', input: 'scripts/rcc', - command: [prog_python, '@INPUT@', '--compress=Zstd', '--dict=dictionary', '--output=@OUTPUT@', meson.current_source_dir()/'3rd-party/tabler-icons/icons/chevron-up.svg'], + command: [prog_python, '@INPUT@', '--namespace=staticdata', '--output=@OUTPUT@', files('test/resources.xrc')], +) +zstd_resources_h = custom_target('zstd_resources.h', + output: 'zstd_resources.h', + input: 'scripts/rcc', + command: [prog_python, '@INPUT@', '--namespace=zstd_data', '--compress=Zstd', '--dict=dictionary', '--output=@OUTPUT@', files('test/resources.xrc')], ) test('libembed', executable('embed', - sources: [ 'test/main.cpp', resources_h ], - dependencies: [ dep_gtest, dep_libembed ] - ), - env: environment({ 'CONFIGFILE' : meson.current_source_dir()/'test/defaultrc.ini' }), - workdir: meson.current_source_dir()/'test' + sources: [ 'test/main.cpp', resources_h, zstd_resources_h ], + dependencies: [ dep_embed ] + ) ) -- cgit v1.2.1