mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
Use a meson "generator" to deduplicate .gen.hh
creation
This commit is contained in:
parent
d8850618b6
commit
6e5cec292b
7
build-utils-meson/generate-header/meson.build
Normal file
7
build-utils-meson/generate-header/meson.build
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
bash = find_program('bash', native: true)
|
||||||
|
|
||||||
|
gen_header = generator(
|
||||||
|
bash,
|
||||||
|
arguments : [ '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ],
|
||||||
|
output : '@PLAINNAME@.gen.hh',
|
||||||
|
)
|
@ -6,6 +6,7 @@ project('nix-dev-shell', 'cpp',
|
|||||||
subproject_dir : 'src',
|
subproject_dir : 'src',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Internal Libraries
|
||||||
subproject('libutil')
|
subproject('libutil')
|
||||||
subproject('libstore')
|
subproject('libstore')
|
||||||
subproject('libfetchers')
|
subproject('libfetchers')
|
||||||
@ -18,7 +19,7 @@ subproject('libcmd')
|
|||||||
subproject('internal-api-docs')
|
subproject('internal-api-docs')
|
||||||
subproject('external-api-docs')
|
subproject('external-api-docs')
|
||||||
|
|
||||||
# C wrappers
|
# External C wrapper libraries
|
||||||
subproject('libutil-c')
|
subproject('libutil-c')
|
||||||
subproject('libstore-c')
|
subproject('libstore-c')
|
||||||
subproject('libexpr-c')
|
subproject('libexpr-c')
|
||||||
|
@ -116,20 +116,17 @@ lexer_tab = custom_target(
|
|||||||
install_dir : get_option('includedir') / 'nix',
|
install_dir : get_option('includedir') / 'nix',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
subdir('build-utils-meson/generate-header')
|
||||||
|
|
||||||
generated_headers = []
|
generated_headers = []
|
||||||
foreach header : [
|
foreach header : [
|
||||||
'imported-drv-to-derivation.nix',
|
'imported-drv-to-derivation.nix',
|
||||||
'fetchurl.nix',
|
'fetchurl.nix',
|
||||||
'call-flake.nix',
|
'call-flake.nix',
|
||||||
]
|
]
|
||||||
generated_headers += custom_target(
|
generated_headers += gen_header.process(header)
|
||||||
command : [ 'bash', '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ],
|
|
||||||
input : header,
|
|
||||||
output : '@PLAINNAME@.gen.hh',
|
|
||||||
)
|
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
|
||||||
sources = files(
|
sources = files(
|
||||||
'attr-path.cc',
|
'attr-path.cc',
|
||||||
'attr-set.cc',
|
'attr-set.cc',
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
foreach header : [
|
generated_headers += gen_header.process(
|
||||||
'derivation.nix',
|
'derivation.nix',
|
||||||
]
|
preserve_path_from: meson.project_source_root(),
|
||||||
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',
|
|
||||||
)
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
sources += files(
|
sources += files(
|
||||||
'context.cc',
|
'context.cc',
|
||||||
|
@ -99,18 +99,14 @@ deps_public += nlohmann_json
|
|||||||
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
|
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
|
||||||
deps_private += sqlite
|
deps_private += sqlite
|
||||||
|
|
||||||
|
subdir('build-utils-meson/generate-header')
|
||||||
|
|
||||||
generated_headers = []
|
generated_headers = []
|
||||||
foreach header : [
|
foreach header : [
|
||||||
'schema.sql',
|
'schema.sql',
|
||||||
'ca-specific-schema.sql',
|
'ca-specific-schema.sql',
|
||||||
]
|
]
|
||||||
generated_headers += custom_target(
|
generated_headers += gen_header.process(header)
|
||||||
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',
|
|
||||||
)
|
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
busybox = find_program(get_option('sandbox-shell'), required : false)
|
busybox = find_program(get_option('sandbox-shell'), required : false)
|
||||||
|
Loading…
Reference in New Issue
Block a user