Skip to content
Merged

Fix CI #1389

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions examples/cxx/build-and-run-crashinfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ if ($USE_MSVC) {
Write-Host "Using MSVC compiler" -ForegroundColor Yellow

# MSVC compilation
cl.exe /std:c++20 /EHsc `
# Use /MD (dynamic CRT) to match the default Rust build
cl.exe /std:c++20 /EHsc /MD `
/I"$CXX_BRIDGE_INCLUDE" `
/I"$CXX_BRIDGE_CRATE" `
/I"$RUST_CXX_INCLUDE" `
Expand All @@ -118,6 +119,7 @@ if ($USE_MSVC) {
"$CRASHTRACKER_LIB" `
"$CXX_BRIDGE_LIB" `
ws2_32.lib advapi32.lib userenv.lib ntdll.lib bcrypt.lib `
dbghelp.lib psapi.lib ole32.lib powrprof.lib `
/Fe:examples\cxx\crashinfo.exe

if ($LASTEXITCODE -ne 0) {
Expand All @@ -137,7 +139,9 @@ if ($USE_MSVC) {
examples/cxx/crashinfo.cpp `
"$CXX_BRIDGE_LIB" `
"$CRASHTRACKER_LIB" `
-lws2_32 -ladvapi32 -luserenv -lntdll -lbcrypt -lgcc_eh -lpthread `
-lws2_32 -ladvapi32 -luserenv -lntdll -lbcrypt `
-ldbghelp -lpsapi -lole32 -lpowrprof `
-lgcc_eh -lpthread `
-o examples/cxx/crashinfo.exe

if ($LASTEXITCODE -ne 0) {
Expand Down
11 changes: 8 additions & 3 deletions libdd-crashtracker/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ pub use libdd_common::cc_utils::cc;
// Build CXX bridge - cross-platform function
#[cfg(feature = "cxx")]
fn build_cxx_bridge() {
cxx_build::bridge("src/crash_info/cxx.rs")
.flag_if_supported("-std=c++20")
.compile("libdd-crashtracker-cxx");
let mut build = cxx_build::bridge("src/crash_info/cxx.rs");
build.flag_if_supported("-std=c++20");

// On Windows, use dynamic CRT (/MD) to match the default Rust build
#[cfg(target_os = "windows")]
build.static_crt(false);

build.compile("libdd-crashtracker-cxx");

println!("cargo:rerun-if-changed=src/crash_info/cxx.rs");
}
Expand Down
Loading