1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-18 00:12:43 +01:00

Meson build for libexpr and libflake

This commit is contained in:
John Ericson 2024-06-26 22:15:33 -04:00
parent fbdc554908
commit 31257009e1
16 changed files with 731 additions and 122 deletions

View file

@ -20,6 +20,9 @@ deps_private = [ ]
# See note in ../nix-util/meson.build
deps_public = [ ]
# See note in ../nix-util/meson.build
deps_public_subproject = [ ]
# See note in ../nix-util/meson.build
deps_other = [ ]
@ -30,13 +33,17 @@ configdata.set_quoted('PACKAGE_VERSION', meson.project_version())
configdata.set_quoted('SYSTEM', host_machine.system())
nix_util = dependency('nix-util')
if nix_util.type_name() == 'internal'
# subproject sadly no good for pkg-config module
deps_other += nix_util
else
deps_public += nix_util
endif
foreach nix_dep : [
dependency('nix-util'),
]
if nix_dep.type_name() == 'internal'
deps_public_subproject += nix_dep
# subproject sadly no good for pkg-config module
deps_other += nix_dep
else
deps_public += nix_dep
endif
endforeach
run_command('ln', '-s',
meson.project_build_root() / '__nothing_link_target',
@ -122,13 +129,16 @@ if enable_embedded_sandbox_shell
endif
generated_headers = []
foreach header : [ 'schema.sql', 'ca-specific-schema.sql' ]
foreach header : [
'schema.sql',
'ca-specific-schema.sql',
]
generated_headers += custom_target(
command : [ 'bash', '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ],
input : header,
output : '@PLAINNAME@.gen.hh',
install : true,
install_dir : get_option('includedir') / 'nix'
install_dir : get_option('includedir') / 'nix',
)
endforeach
@ -248,7 +258,7 @@ include_dirs = [
include_directories('build'),
]
headers = [config_h] +files(
headers = [config_h] + files(
'binary-cache-store.hh',
'build-result.hh',
'build/derivation-goal.hh',
@ -427,11 +437,9 @@ this_library = library(
install_headers(headers, subdir : 'nix', preserve_path : true)
requires = []
if nix_util.type_name() == 'internal'
# `requires` cannot contain declared dependencies (from the
# subproject), so we need to do this manually
requires += 'nix-util'
endif
foreach dep : deps_public_subproject
requires += dep.name()
endforeach
requires += deps_public
import('pkgconfig').generate(
@ -450,5 +458,5 @@ meson.override_dependency(meson.project_name(), declare_dependency(
include_directories : include_dirs,
link_with : this_library,
compile_args : ['-std=c++2a'],
dependencies : [nix_util],
dependencies : deps_public_subproject + deps_public,
))

View file

@ -23,9 +23,6 @@
# Check test coverage of Nix. Probably want to use with at least
# one of `doCheck` or `doInstallCheck` enabled.
, withCoverageChecks ? false
# Avoid setting things that would interfere with a functioning devShell
, forDevShell ? false
}:
let