Don't call find_package(WindowsSDK) if the platform ver is already set

This commit is contained in:
Chris Robinson 2020-07-08 23:32:24 -07:00
parent da25557ed6
commit c1383e3a48
2 changed files with 13 additions and 10 deletions

View File

@ -846,10 +846,13 @@ option(ALSOFT_REQUIRE_WASAPI "Require WASAPI backend" OFF)
if(WIN32)
set(WINSDK_LIB_DIRS )
set(WINSDK_INCLUDE_DIRS )
find_package(WindowsSDK)
if(WINDOWSSDK_FOUND)
get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
if(NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
find_package(WindowsSDK)
if(WINDOWSSDK_FOUND)
get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
endif()
endif()
# Check MMSystem backend

View File

@ -8,12 +8,12 @@
# DSOUND_LIBRARY - the dsound library
#
if (WIN32)
FIND_PACKAGE(WindowsSDK)
if (WINDOWSSDK_FOUND)
get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
endif()
if(WIN32 AND NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
find_package(WindowsSDK)
if(WINDOWSSDK_FOUND)
get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
endif()
endif()
# DSOUND_INCLUDE_DIR