repo: Allow BUILD_LOADER=OFF on Windows

If the repo is built without the loader, cmake will now look for an
SDK installation on Windows. On Linux, it will look in the standard
system paths for a loader.
This commit is contained in:
Lenny Komow 2018-05-17 14:59:13 -06:00
parent 3ce4ee6fce
commit 070da24679

View File

@ -98,7 +98,19 @@ if(NOT WIN32)
COMPILE_FLAGS "-Wno-sign-compare")
endif()
target_link_libraries(vk_loader_validation_tests vulkan gtest gtest_main)
if(TARGET vulkan)
set(LOADER_LIB vulkan)
elseif(WIN32 AND NOT $ENV{VULKAN_SDK} EQUAL "")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(LOADER_LIB "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
else()
set(LOADER_LIB "$ENV{VULKAN_SDK}/Lib32/vulkan-1.lib")
endif()
else()
set(LOADER_LIB vulkan)
endif()
target_link_libraries(vk_loader_validation_tests "${LOADER_LIB}" gtest gtest_main)
if(BUILD_LOADER AND ENABLE_STATIC_LOADER)
set_target_properties(vk_loader_validation_tests PROPERTIES LINK_FLAGS "/ignore:4098")
endif()