@@ -20,7 +20,8 @@ use std::fs;
20
20
use std:: path:: { Path , PathBuf } ;
21
21
22
22
static SHADERC_STATIC_LIB : & str = "shaderc_combined" ;
23
- static SHADERC_SHARED_LIB : & str = "shaderc_shared" ;
23
+ static SHADERC_SHARED_LIB0 : & str = "shaderc" ;
24
+ static SHADERC_SHARED_LIB1 : & str = "shaderc_shared" ;
24
25
static SHADERC_STATIC_LIB_FILE_UNIX : & str = "libshaderc_combined.a" ;
25
26
static SHADERC_STATIC_LIB_FILE_WIN : & str = "shaderc_combined.lib" ;
26
27
static MIN_VULKAN_SDK_VERSION : u32 = 182 ;
@@ -286,24 +287,35 @@ fn main() {
286
287
SHADERC_STATIC_LIB_FILE_UNIX
287
288
} ) ;
288
289
289
- let dylib_name = format ! (
290
+ let dylib0_name = format ! (
290
291
"{}{}{}" ,
291
292
consts:: DLL_PREFIX ,
292
- SHADERC_SHARED_LIB ,
293
+ SHADERC_SHARED_LIB0 ,
293
294
consts:: DLL_SUFFIX
294
295
) ;
295
- let dylib_path = search_dir. join ( dylib_name) ;
296
+ let dylib1_name = format ! (
297
+ "{}{}{}" ,
298
+ consts:: DLL_PREFIX ,
299
+ SHADERC_SHARED_LIB1 ,
300
+ consts:: DLL_SUFFIX
301
+ ) ;
302
+ let dylib0_path = search_dir. join ( dylib0_name) ;
303
+ let dylib1_path = search_dir. join ( dylib1_name) ;
296
304
297
305
if let Some ( ( lib_name, lib_kind) ) = {
298
306
match (
299
- dylib_path. exists ( ) ,
307
+ dylib0_path. exists ( ) ,
308
+ dylib1_path. exists ( ) ,
300
309
static_lib_path. exists ( ) ,
301
310
config_prefer_static_linking,
302
311
) {
303
312
// If dylib not exist OR prefer static lib and static lib exist, static.
304
- ( false , true , _) | ( _, true , true ) => Some ( ( SHADERC_STATIC_LIB , "static" ) ) ,
313
+ ( false , false , true , _) | ( _, _, true , true ) => {
314
+ Some ( ( SHADERC_STATIC_LIB , "static" ) )
315
+ }
305
316
// Otherwise, if dylib exist, dynamic.
306
- ( true , _, _) => Some ( ( SHADERC_SHARED_LIB , "dylib" ) ) ,
317
+ ( true , _, _, _) => Some ( ( SHADERC_SHARED_LIB0 , "dylib" ) ) ,
318
+ ( _, true , _, _) => Some ( ( SHADERC_SHARED_LIB1 , "dylib" ) ) ,
307
319
// Neither dylib nor static lib exist.
308
320
_ => None ,
309
321
}
0 commit comments