diff options
| author | Stefan Boberg <[email protected]> | 2021-11-04 14:18:54 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-11-04 14:19:05 +0100 |
| commit | 472569d4a5f2daaef7e234d93b417ccb650be624 (patch) | |
| tree | 085c33f178855ad5ffe48b01bf99d41516ffa011 /thirdparty/BLAKE3/tools/compiler_version/src/main.rs | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-472569d4a5f2daaef7e234d93b417ccb650be624.tar.xz zen-472569d4a5f2daaef7e234d93b417ccb650be624.zip | |
Renamed 3rdparty -> thirdparty for legal compliance
Diffstat (limited to 'thirdparty/BLAKE3/tools/compiler_version/src/main.rs')
| -rw-r--r-- | thirdparty/BLAKE3/tools/compiler_version/src/main.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/thirdparty/BLAKE3/tools/compiler_version/src/main.rs b/thirdparty/BLAKE3/tools/compiler_version/src/main.rs new file mode 100644 index 000000000..767cb31bd --- /dev/null +++ b/thirdparty/BLAKE3/tools/compiler_version/src/main.rs @@ -0,0 +1,27 @@ +use std::process::Command; + +fn main() { + // Print the rustc version. + Command::new(env!("CARGO")) + .args(&["rustc", "--quiet", "--", "--version"]) + .status() + .unwrap(); + println!(); + + // Print the Cargo version. + Command::new(env!("CARGO")) + .args(&["--version"]) + .status() + .unwrap(); + println!(); + + // Print the C compiler version. This relies on C compiler detection done + // in build.rs, which sets the COMPILER_PATH variable. + let compiler_path = env!("COMPILER_PATH"); + let mut compiler_command = Command::new(compiler_path); + // Use the --version flag on everything other than MSVC. + if !cfg!(target_env = "msvc") { + compiler_command.arg("--version"); + } + let _ = compiler_command.status().unwrap(); +} |