Skip to content

Commit b9da73f

Browse files
committed
Added patch for build script Windows
1 parent d082960 commit b9da73f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,20 @@ fn main() -> Result<(), Box<dyn Error>> {
339339
println!("cargo:warning=libobs-d3d11/CMakeLists.txt not found, skipping");
340340
}
341341

342+
// Same fix for libobs-winrt which also uses set_target_properties LINK_FLAGS.
343+
println!("cargo:warning=Step: patch libobs-winrt/CMakeLists.txt to force /DEBUG:FASTLINK");
344+
let winrt_cmake = obs_src.join("libobs-winrt/CMakeLists.txt");
345+
if winrt_cmake.exists() {
346+
let content = fs::read_to_string(&winrt_cmake)?;
347+
if !content.contains("PATCHED: /DEBUG:FASTLINK") {
348+
let patched = content + "\n# PATCHED: /DEBUG:FASTLINK so the linker writes libobs-winrt.pdb\nif(MSVC)\n set_property(TARGET libobs-winrt APPEND_STRING PROPERTY LINK_FLAGS \" /DEBUG:FASTLINK\")\nendif()\n";
349+
fs::write(&winrt_cmake, patched)?;
350+
println!("cargo:warning=Patched libobs-winrt/CMakeLists.txt");
351+
}
352+
} else {
353+
println!("cargo:warning=libobs-winrt/CMakeLists.txt not found, skipping");
354+
}
355+
342356
// Windows SDK version: prefer CMAKE_SYSTEM_VERSION env var (set by workflow)
343357
let sdk_ver = env::var("CMAKE_SYSTEM_VERSION")
344358
.unwrap_or_else(|_| "10.0.20348.0".to_string());

0 commit comments

Comments
 (0)