aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-03-27 16:58:18 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-03-27 16:58:18 +0200
commit9c053ec1b1c7cd91ca6c0cc6f65803cc3f114c7f (patch)
tree70f49e064a00d3abdc0f6da3854a5b237ffc77ef /meson.build
parentInitial commit (diff)
downloadrcc-9c053ec1b1c7cd91ca6c0cc6f65803cc3f114c7f.tar.xz
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
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build30
1 files changed, 19 insertions, 11 deletions
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 ]
+ )
)