28 lines
876 B
Meson
28 lines
876 B
Meson
project('nix-shorturl-plugin', 'cpp',
|
|
version : '0.1.0',
|
|
default_options : [
|
|
'cpp_std=c++23',
|
|
'warning_level=2',
|
|
],
|
|
)
|
|
|
|
nix_fetchers = dependency('nix-fetchers')
|
|
nix_util = dependency('nix-util')
|
|
nix_store = dependency('nix-store')
|
|
nlohmann_json = dependency('nlohmann_json', version : '>=3.9')
|
|
|
|
if nix_fetchers.version().version_compare('<2.34')
|
|
add_project_arguments('-DNIX_PRE_234', language : 'cpp')
|
|
message('Using pre-2.34 Nix fetcher API (nix-fetchers @ ' + nix_fetchers.version() + ')')
|
|
else
|
|
message('Using post-2.34 Nix fetcher API (nix-fetchers @ ' + nix_fetchers.version() + ')')
|
|
endif
|
|
|
|
plugin = shared_library('nix-shorturl-plugin',
|
|
'src/plugin.cc',
|
|
'src/shorturl-scheme.cc',
|
|
'src/config.cc',
|
|
dependencies : [nix_fetchers, nix_util, nix_store, nlohmann_json],
|
|
install : true,
|
|
install_dir : get_option('libdir') / 'nix' / 'plugins',
|
|
)
|