#build #command #run

compile-time-run

run a command at compile time and capture the output

13 releases

0.2.12 Jul 7, 2021
0.2.11 Jul 16, 2020
0.2.8 Oct 17, 2019
0.2.6 Apr 15, 2019
0.1.0 Mar 24, 2019

#39 in Procedural macros

Download history 1868/week @ 2021-07-04 1480/week @ 2021-07-11 1686/week @ 2021-07-18 1557/week @ 2021-07-25 1606/week @ 2021-08-01 1334/week @ 2021-08-08 1783/week @ 2021-08-15 1605/week @ 2021-08-22 1090/week @ 2021-08-29 1365/week @ 2021-09-05 1819/week @ 2021-09-12 1373/week @ 2021-09-19 1182/week @ 2021-09-26 2133/week @ 2021-10-03 2737/week @ 2021-10-10 1814/week @ 2021-10-17

7,786 downloads per month
Used in 2 crates

BSD-2-Clause

10KB
92 lines

Documentation crates.io Build Status

compile-time-run

This crate contains macros to run commands on the host system at compile time. It can be used in some situations to take over functionaility that would otherwise have to be done using a build script.

An example:

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!");

Keep in mind that running arbitrary commands during your build phase can easily hurt portability.


lib.rs:

This crate contains macros to run commands on the host system at compile time. It can be used in some situations to take over functionaility that would otherwise have to be done using a build script.

An example:

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!");

Keep in mind that running arbitrary commands during your build phase can easily hurt portability.

Dependencies

~305–730KB
~18K SLoC

`