@@ -12,6 +12,7 @@ fn enable_playlist() -> &'static str {
1212 "OFF"
1313 }
1414}
15+
1516// Are we linking to shared or static libraries?
1617fn build_shared_libs_flag ( ) -> & ' static str {
1718 if cfg ! ( feature = "static" ) {
@@ -71,22 +72,28 @@ fn main() {
7172
7273 // Define the installation path for vcpkg
7374 let vcpkg_installed = vcpkg_root. join ( "installed" ) . join ( "x64-windows-static-md" ) ;
75+ let vcpkg_installed_str = vcpkg_installed. to_str ( ) . unwrap ( ) ;
76+
77+ // Define projectM_Eval_DIR and store in a variable
78+ let projectm_eval_dir = projectm_path. join ( "vendor" ) . join ( "projectm-eval" ) ;
79+ let projectm_eval_dir_str = projectm_eval_dir. to_str ( ) . unwrap ( ) ;
80+
81+ // Convert vcpkg_toolchain to string
82+ let vcpkg_toolchain_str = vcpkg_toolchain. to_str ( ) . unwrap ( ) ;
7483
7584 // Configure and build libprojectM using CMake for Windows
76- let mut cmake_config = cmake:: Config :: new ( & projectm_path)
85+ let mut cmake_config = cmake:: Config :: new ( & projectm_path) ;
86+ cmake_config
7787 . generator ( "Visual Studio 17 2022" )
78- . define ( "CMAKE_TOOLCHAIN_FILE" , & vcpkg_toolchain )
88+ . define ( "CMAKE_TOOLCHAIN_FILE" , vcpkg_toolchain_str )
7989 . define ( "VCPKG_TARGET_TRIPLET" , "x64-windows-static-md" )
8090 . define (
8191 "CMAKE_MSVC_RUNTIME_LIBRARY" ,
8292 "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" ,
8393 )
8494 . define ( "ENABLE_PLAYLIST" , enable_playlist_flag)
85- . define (
86- "projectM_Eval_DIR" ,
87- & projectm_path. join ( "vendor" ) . join ( "projectm-eval" ) ,
88- )
89- . define ( "CMAKE_PREFIX_PATH" , & vcpkg_installed)
95+ . define ( "projectM_Eval_DIR" , projectm_eval_dir_str)
96+ . define ( "CMAKE_PREFIX_PATH" , vcpkg_installed_str)
9097 . define ( "CMAKE_VERBOSE_MAKEFILE" , "ON" )
9198 . define ( "BUILD_TESTING" , "OFF" )
9299 . define ( "BUILD_EXAMPLES" , "OFF" )
0 commit comments