-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rustversion dependency to meson build
- Loading branch information
Showing
5 changed files
with
59 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
project( | ||
'rustversion', | ||
'rust', | ||
default_options: ['rust_std=2018'], | ||
license: 'MIT OR Apache-2.0', | ||
meson_version: '>= 1.3.0', | ||
version: '1.0.18', | ||
) | ||
|
||
rust = import('rust') | ||
|
||
build = executable( | ||
'build_script', | ||
native: true, | ||
sources: files('build/build.rs'), | ||
) | ||
|
||
rustc_args = custom_target( | ||
command: [ | ||
find_program('python3'), | ||
'@SOURCE_ROOT@/tools/meson/buildscript_run.py', | ||
'--buildscript', | ||
build, | ||
'--manifest-dir', | ||
'@CURRENT_SOURCE_DIR@', | ||
'--rustc-wrapper', | ||
'@BUILD_ROOT@/tools/meson/rustc_wrapper.sh', | ||
'--out-dir', | ||
'@PRIVATE_DIR@', | ||
'--rustc-args', | ||
'@OUTPUT@', | ||
], | ||
env: {'HOST': 'x86_64-unknown-linux-gnu'}, | ||
# Hack: any extension other than .rs causes a failure "ERROR: Rust target | ||
# rustversion contains a non-rust source file" below, and forces the use of | ||
# `structured_sources` which would mean listing out every source file in the | ||
# crate, instead of just the crate root lib.rs. | ||
output: 'rustc_args.out.rs', | ||
) | ||
|
||
lib = rust.proc_macro( | ||
'rustversion', | ||
rust_args: ['@' + rustc_args.full_path()], | ||
sources: [files('src/lib.rs'), rustc_args], | ||
) | ||
|
||
dep = declare_dependency(link_with: lib) | ||
meson.override_dependency('rustversion', dep) |
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,6 @@ | ||
[wrap-file] | ||
directory = rustversion-1.0.18 | ||
source_url = https://static.crates.io/crates/rustversion/1.0.18/download | ||
source_filename = rustversion-1.0.18.tar.gz | ||
source_hash = 0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248 | ||
patch_directory = rustversion |
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