@@ -277,19 +277,21 @@ macro(configure_sdk_windows name environment architectures)
277
277
set (WinSDK${arch}UMDir "$ENV{UniversalCRTSdkDir} /Lib/$ENV{UCRTVersion} /um/${WinSDKArchitecture} " )
278
278
set (OverlayDirectory "${CMAKE_BINARY_DIR} /winsdk_lib_${arch} _symlinks" )
279
279
280
- file (MAKE_DIRECTORY ${OverlayDirectory} )
281
-
282
- file (GLOB libraries RELATIVE "${WinSDK${arch} UMDir}" "${WinSDK${arch} UMDir}/*" )
283
- foreach (library ${libraries} )
284
- get_filename_component (name_we "${library} " NAME_WE )
285
- get_filename_component (ext "${library} " EXT )
286
- string (TOLOWER "${ext} " lowercase_ext )
287
- set (lowercase_ext_symlink_name "${name_we}${lowercase_ext} " )
288
- if (NOT library STREQUAL lowercase_ext_symlink_name )
289
- execute_process (COMMAND
290
- "${CMAKE_COMMAND} " -E create_symlink "${WinSDK${arch} UMDir}/${library} " "${OverlayDirectory} /${lowercase_ext_symlink_name} " )
291
- endif ()
292
- endforeach ()
280
+ if (NOT EXISTS "$ENV{UniversalCRTSdkDir} /Include/$ENV{UCRTVersion} /um/WINDOWS.H" )
281
+ file (MAKE_DIRECTORY ${OverlayDirectory} )
282
+
283
+ file (GLOB libraries RELATIVE "${WinSDK${arch} UMDir}" "${WinSDK${arch} UMDir}/*" )
284
+ foreach (library ${libraries} )
285
+ get_filename_component (name_we "${library} " NAME_WE )
286
+ get_filename_component (ext "${library} " EXT )
287
+ string (TOLOWER "${ext} " lowercase_ext )
288
+ set (lowercase_ext_symlink_name "${name_we}${lowercase_ext} " )
289
+ if (NOT library STREQUAL lowercase_ext_symlink_name )
290
+ execute_process (COMMAND
291
+ "${CMAKE_COMMAND} " -E create_symlink "${WinSDK${arch} UMDir}/${library} " "${OverlayDirectory} /${lowercase_ext_symlink_name} " )
292
+ endif ()
293
+ endforeach ()
294
+ endif ()
293
295
endforeach ()
294
296
295
297
# Add this to the list of known SDKs.
0 commit comments