mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2024-11-30 10:51:28 +00:00
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:
parent
3ce4ee6fce
commit
070da24679
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user