|
| 1 | +project('nix-fetchers-c', 'cpp', |
| 2 | + version : files('.version'), |
| 3 | + default_options : [ |
| 4 | + 'cpp_std=c++2a', |
| 5 | + # TODO(Qyriad): increase the warning level |
| 6 | + 'warning_level=1', |
| 7 | + 'errorlogs=true', # Please print logs for tests that fail |
| 8 | + ], |
| 9 | + meson_version : '>= 1.1', |
| 10 | + license : 'LGPL-2.1-or-later', |
| 11 | +) |
| 12 | + |
| 13 | +cxx = meson.get_compiler('cpp') |
| 14 | + |
| 15 | +subdir('nix-meson-build-support/deps-lists') |
| 16 | + |
| 17 | +deps_private_maybe_subproject = [ |
| 18 | + dependency('nix-util'), |
| 19 | + dependency('nix-store'), |
| 20 | + dependency('nix-fetchers'), |
| 21 | +] |
| 22 | +deps_public_maybe_subproject = [ |
| 23 | + dependency('nix-util-c'), |
| 24 | + dependency('nix-store-c'), |
| 25 | +] |
| 26 | +subdir('nix-meson-build-support/subprojects') |
| 27 | + |
| 28 | +add_project_arguments( |
| 29 | + language : 'cpp', |
| 30 | +) |
| 31 | + |
| 32 | +subdir('nix-meson-build-support/common') |
| 33 | + |
| 34 | +sources = files( |
| 35 | + 'nix_api_fetchers.cc', |
| 36 | +) |
| 37 | + |
| 38 | +include_dirs = [include_directories('.')] |
| 39 | + |
| 40 | +headers = files( |
| 41 | + 'nix_api_fetchers.h', |
| 42 | + 'nix_api_fetchers_internal.hh', |
| 43 | +) |
| 44 | + |
| 45 | +# TODO move this header to libexpr, maybe don't use it in tests? |
| 46 | +headers += files('nix_api_fetchers.h') |
| 47 | + |
| 48 | +subdir('nix-meson-build-support/export-all-symbols') |
| 49 | +subdir('nix-meson-build-support/windows-version') |
| 50 | + |
| 51 | +this_library = library( |
| 52 | + 'nixfetchersc', |
| 53 | + sources, |
| 54 | + dependencies : deps_public + deps_private + deps_other, |
| 55 | + include_directories : include_dirs, |
| 56 | + link_args: linker_export_flags, |
| 57 | + prelink : true, # For C++ static initializers |
| 58 | + install : true, |
| 59 | +) |
| 60 | + |
| 61 | +install_headers(headers, preserve_path : true) |
| 62 | + |
| 63 | +libraries_private = [] |
| 64 | + |
| 65 | +subdir('nix-meson-build-support/export') |
0 commit comments