Skip to content

Commit

Permalink
add vcpkg stuff back
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed Oct 31, 2024
1 parent 9333b16 commit 5a3c3e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions projectm-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include = [
"libprojectM/**/*.h",
"libprojectM/**/*.hpp",
"libprojectM/config*",
"libprojectM/vcpkg*",
"bindgen/**",
]

Expand Down
19 changes: 18 additions & 1 deletion projectm-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,24 @@ fn main() {

// Platform-specific configurations
if cfg!(target_os = "windows") {
// Windows-specific configurations (if any)
let vcpkg_root = match env::var("VCPKG_INSTALLATION_ROOT") {
Ok(val) => val,
Err(_) => {
println!("cargo:warning=VCPKG_INSTALLATION_ROOT is not set. Please set it to your VCPKG installation directory.");
std::process::exit(1);
}
};
cmake_config
.generator("Visual Studio 17 2022")
.define(
"CMAKE_TOOLCHAIN_FILE",
format!("{}/scripts/buildsystems/vcpkg.cmake", vcpkg_root),
)
.define("VCPKG_TARGET_TRIPLET", "x64-windows-static-md")
.define(
"CMAKE_MSVC_RUNTIME_LIBRARY",
"MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
);
} else if cfg!(target_os = "emscripten") {
cmake_config.define("ENABLE_EMSCRIPTEN", "ON");
}
Expand Down

0 comments on commit 5a3c3e8

Please sign in to comment.