-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dnsdist: Fix remaining build issues for YAML with meson
- Loading branch information
Showing
10 changed files
with
124 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
sources = files( | ||
'dnsdist-settings-generator.py', | ||
'../dnsdist-settings-definitions.yml', | ||
'dnsdist-configuration-yaml-items-generated-pre-in.cc', | ||
'dnsdist-configuration-yaml-items-generated.cc', | ||
'dnsdist-settings-documentation-generator.py', | ||
'rust-pre-in.rs', | ||
'rust-middle-in.rs', | ||
'rust-post-in.rs', | ||
) | ||
|
||
generated = [ | ||
'dnsdist-configuration-yaml-items-generated.cc', | ||
] | ||
|
||
python = find_program('python3') | ||
|
||
rust_lib_sources = custom_target( | ||
command: [python, '@INPUT0@', '@INPUT1@', '@SOURCE_ROOT@/dnsdist-rust-lib', '@BUILD_ROOT@/dnsdist-rust-lib'], | ||
input: sources, | ||
output: generated, | ||
) | ||
|
||
dep_rust_lib = declare_dependency( | ||
sources: [rust_lib_sources,], | ||
include_directories: [include_directories('.'), ] | ||
) | ||
|
||
subdir('rust') |
13 changes: 13 additions & 0 deletions
13
pdns/dnsdistdist/dnsdist-rust-lib/rust/build_dnsdist_rust_library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh -e | ||
|
||
#echo "PWD=$PWD" | ||
#echo "srcdir=$srcdir" | ||
#echo "builddir=$builddir" | ||
|
||
$CARGO build --release $RUST_TARGET --target-dir=$builddir/target --manifest-path $srcdir/Cargo.toml | ||
|
||
cp -p target/$RUSTC_TARGET_ARCH/release/libdnsdist_rust.a $builddir/dnsdist-rust-lib/rust/libdnsdist_rust.a | ||
cp -p target/$RUSTC_TARGET_ARCH/cxxbridge/dnsdist-rust/src/lib.rs.h $srcdir/lib.rs.h | ||
cp -p target/$RUSTC_TARGET_ARCH/cxxbridge/dnsdist-rust/src/lib.rs.h $builddir/dnsdist-rust-lib/rust/lib.rs.h | ||
cp -p target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $srcdir/cxx.h | ||
cp -p target/$RUSTC_TARGET_ARCH/cxxbridge/rust/cxx.h $builddir/dnsdist-rust-lib/rust/cxx.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
build = find_program('build_dnsdist_rust_library') | ||
cargo = find_program('cargo') | ||
infile = 'Cargo.toml' | ||
outfile = 'libdnsdist_rust.a' | ||
|
||
env = environment() | ||
env.append('CARGO', cargo.full_path()) | ||
env.append('SYSCONFDIR', conf.get('SYSCONFDIR')) | ||
env.append('builddir', '.') | ||
env.append('srcdir', meson.current_source_dir()) | ||
env.append('RUST_TARGET', '') | ||
env.append('RUSTC_TARGET_ARCH', '') | ||
|
||
lib_dnsdist_rust = custom_target('libdnsdist_rust.a', | ||
output: [outfile, 'cxx.h'], | ||
input: infile, | ||
command: [build, | ||
], | ||
depend_files: [ | ||
'src/helpers.rs', | ||
], | ||
depends: rust_lib_sources, | ||
env: env, | ||
console: true, | ||
) | ||
|
||
dep_dnsdist_rust_lib = declare_dependency( | ||
link_with: lib_dnsdist_rust[0], | ||
sources: lib_dnsdist_rust[1], | ||
include_directories: [include_directories('..')], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
opt_yaml = get_option('yaml') | ||
|
||
conf.set('HAVE_YAML_CONFIGURATION', opt_yaml.allowed(), description: 'Whether we have YAML configuration') | ||
|
||
summary('YAML configuration', opt_yaml, bool_yn: true, section: 'YAML configuration') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters