Skip to content

Commit e07a058

Browse files
authored
chore: use DLL_PREFIX, DLL_SUFFIX instead of custom DYN_LIB (#40)
1 parent 3083721 commit e07a058

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/commands.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use indexmap::IndexMap;
44
use memoize::memoize;
55
use serde_json::Value;
66
use std::collections::HashMap;
7+
use std::env::consts::DLL_SUFFIX;
78
use std::io::{BufRead, BufReader, Write};
89
use std::path::{Path, PathBuf};
910
use std::process::{Command, Stdio};
@@ -328,7 +329,7 @@ impl CargoBuildExterns {
328329
.find(|f| f.ends_with(".rmeta"))
329330
.or_else(|| files.iter().find(|f| f.ends_with(".rlib")))
330331
.or_else(|| files.iter().find(|f| f.ends_with(".cdylib")))
331-
.or_else(|| files.iter().find(|f| f.ends_with(".so")))
332+
.or_else(|| files.iter().find(|f| f.ends_with(DLL_SUFFIX)))
332333
.unwrap_or(&files[0])
333334
.to_string();
334335
let dep = DependentLibrary {

src/doc.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use cargo_metadata::MetadataCommand;
33
use colored::Colorize;
44
use indexmap::IndexMap;
55
use std::collections::HashSet;
6+
use std::env::consts::{DLL_PREFIX, DLL_SUFFIX};
67
use std::path::{Path, PathBuf};
78
use std::process::Command;
89

@@ -111,15 +112,16 @@ fn generate_single_target_doc(
111112

112113
// Add extern dependencies for verus_builtin_macros (proc-macro -> host triple)
113114
let builtin_macros_path =
114-
verus_target_dir.join(format!("verus_builtin_macros{}", verus::DYN_LIB));
115+
verus_target_dir.join(format!("{DLL_PREFIX}verus_builtin_macros{DLL_SUFFIX}"));
115116
cmd.arg("--extern").arg(format!(
116117
"verus_builtin_macros={}",
117118
builtin_macros_path.display()
118119
));
119120

120121
// Add extern dependencies for verus_state_machines_macros
121-
let state_machine_macros_path =
122-
verus_target_dir.join(format!("verus_state_machines_macros{}", verus::DYN_LIB));
122+
let state_machine_macros_path = verus_target_dir.join(format!(
123+
"{DLL_PREFIX}verus_state_machines_macros{DLL_SUFFIX}"
124+
));
123125
cmd.arg("--extern").arg(format!(
124126
"verus_state_machines_macros={}",
125127
state_machine_macros_path.display()

src/verus.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ pub const Z3_HINT: &str = "tools/verus/source";
3636

3737
pub const VERUSFMT_BIN: &str = "verusfmt";
3838

39-
#[cfg(target_os = "windows")]
40-
pub const DYN_LIB: &str = ".dll";
41-
#[cfg(target_os = "linux")]
42-
pub const DYN_LIB: &str = ".so";
43-
#[cfg(target_os = "macos")]
44-
pub const DYN_LIB: &str = ".dylib";
45-
4639
pub const RUSTDOC_BIN: &str = "rustdoc";
4740

4841
pub const VERUSDOC_BIN: &str = "verusdoc";

0 commit comments

Comments
 (0)