aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build37
1 files changed, 37 insertions, 0 deletions
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..ffae406
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,37 @@
+project('libembed', ['cpp'],
+ default_options: ['cpp_std=c++2a', 'warning_level=3'],
+)
+
+# libstdc++ lacks std::span at the moment
+add_project_arguments(['-stdlib=libc++'], language: 'cpp')
+add_project_link_arguments(['-stdlib=libc++'], language : 'cpp')
+
+dep_zstd = dependency('libzstd')
+dep_gtest = dependency('gtest')
+
+libembed = library('embed',
+ 'lib/embed.cpp',
+ dependencies: [ dep_zstd ],
+ include_directories: '3rd-party/frozen/include/'
+)
+
+dep_libembed = 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'],
+)
+
+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'
+)