13 个版本
0.2.12 | 2021 年 7 月 7 日 |
---|---|
0.2.11 | 2020 年 7 月 16 日 |
0.2.8 | 2019 年 10 月 17 日 |
0.2.6 | 2019 年 4 月 15 日 |
0.1.0 | 2019 年 3 月 24 日 |
#602 在 构建工具
12,901 每月下载量
在 2 crates 中使用
11KB
92 行
compile-time-run
这个 crate 包含在编译时在主机系统上运行命令的宏。在某些情况下,它可以用来替代需要通过构建脚本完成的某些功能。
示例
use compile_time_run::{run_command, run_command_str};
const VALUE_STR : &'static str = run_command_str!("echo", "Hello World!");
const VALUE_BYTES : &'static [u8] = run_command!("echo", "Hello World!");
请注意,在构建阶段运行任意命令可能会严重影响可移植性。
lib.rs
:
这个 crate 包含在编译时在主机系统上运行命令的宏。在某些情况下,它可以用来替代需要通过构建脚本完成的某些功能。
示例
use compile_time_run::{run_command, run_command_str};
const VALUE_STR : &'static str = run_command_str!("echo", "Hello World!");
const VALUE_BYTES : &'static [u8] = run_command!("echo", "Hello World!");
请注意,在构建阶段运行任意命令可能会严重影响可移植性。
依赖项
~1.5MB
~34K SLoC