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') 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', libembed_conf.sources(), dependencies: libembed_conf.dependencies(), include_directories: '3rd-party/frozen/include/' ) 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@', '--namespace=staticdata', '--output=@OUTPUT@', '-', files('test/resources.xrc')], ) zstd_dictionary = custom_target('zstd_dictionary', output: 'zstd_dict', input: 'scripts/rcc', command: [ prog_python, '@INPUT@', 'Zstd', '--train=@OUTPUT@', files('test/resources.xrc') ] ) zstd_resources_h = custom_target('zstd_resources.h', output: 'zstd_resources.h', input: [ 'scripts/rcc', zstd_dictionary ], command: [prog_python, '@INPUT0@', '--namespace=zstd_data', '--output=@OUTPUT@', 'Zstd', '--dict=@INPUT1@', files('test/resources.xrc')], ) test('libembed', executable('embed', sources: [ 'test/main.cpp', resources_h, zstd_resources_h ], dependencies: [ dep_embed ] ) )