File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,8 @@ fn build_libmupdf() {
209
209
210
210
#[ cfg( target_env = "msvc" ) ]
211
211
fn build_libmupdf ( ) {
212
+ use cc:: windows_registry:: find_vs_version;
213
+
212
214
let target = env:: var ( "TARGET" ) . expect ( "TARGET not found in environment" ) ;
213
215
let msvc_platform = if target. contains ( "x86_64" ) {
214
216
"x64"
@@ -258,12 +260,20 @@ fn build_libmupdf() {
258
260
}
259
261
// Enable parallel compilation
260
262
cl_env. push ( "/MP" . to_string ( ) ) ;
263
+ let platform_toolset = env:: var ( "MUPDF_MSVC_PLATFORM_TOOLSET" ) . unwrap_or (
264
+ ( match find_vs_version ( ) {
265
+ Ok ( cc:: windows_registry:: VsVers :: Vs17 ) => "v143" ,
266
+ _ => "v142" ,
267
+ } )
268
+ . to_string ( ) ,
269
+ ) ;
261
270
let d = msbuild
262
271
. args ( & [
263
272
"platform\\ win32\\ mupdf.sln" ,
264
273
"/target:libmupdf" ,
265
274
& format ! ( "/p:Configuration={}" , profile) ,
266
275
& format ! ( "/p:Platform={}" , msvc_platform) ,
276
+ & format ! ( "/p:PlatformToolset={}" , platform_toolset) ,
267
277
] )
268
278
. current_dir ( & build_dir)
269
279
. env ( "CL" , cl_env. join ( " " ) )
You can’t perform that action at this time.
0 commit comments