Skip to content

Commit 5a3c3e8

Browse files
committed
add vcpkg stuff back
1 parent 9333b16 commit 5a3c3e8

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

projectm-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ include = [
3333
"libprojectM/**/*.h",
3434
"libprojectM/**/*.hpp",
3535
"libprojectM/config*",
36+
"libprojectM/vcpkg*",
3637
"bindgen/**",
3738
]
3839

projectm-sys/build.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,24 @@ fn main() {
3333

3434
// Platform-specific configurations
3535
if cfg!(target_os = "windows") {
36-
// Windows-specific configurations (if any)
36+
let vcpkg_root = match env::var("VCPKG_INSTALLATION_ROOT") {
37+
Ok(val) => val,
38+
Err(_) => {
39+
println!("cargo:warning=VCPKG_INSTALLATION_ROOT is not set. Please set it to your VCPKG installation directory.");
40+
std::process::exit(1);
41+
}
42+
};
43+
cmake_config
44+
.generator("Visual Studio 17 2022")
45+
.define(
46+
"CMAKE_TOOLCHAIN_FILE",
47+
format!("{}/scripts/buildsystems/vcpkg.cmake", vcpkg_root),
48+
)
49+
.define("VCPKG_TARGET_TRIPLET", "x64-windows-static-md")
50+
.define(
51+
"CMAKE_MSVC_RUNTIME_LIBRARY",
52+
"MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
53+
);
3754
} else if cfg!(target_os = "emscripten") {
3855
cmake_config.define("ENABLE_EMSCRIPTEN", "ON");
3956
}

0 commit comments

Comments
 (0)