Skip to content

Commit

Permalink
[docs] Clean comments and prints when find vulkan (#4948)
Browse files Browse the repository at this point in the history
  • Loading branch information
zchrissirhcz authored Aug 15, 2023
1 parent 00da925 commit cbd838f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,17 @@ endif()
if(NCNN_VULKAN)
find_package(Vulkan QUIET)
if(NOT Vulkan_FOUND)
message(STATUS "=== CMAKE_SYSTEM_NAME is: ${CMAKE_SYSTEM_NAME}")
if(DEFINED ENV{VULKAN_SDK})
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
list(APPEND CMAKE_MODULE_PATH "$ENV{VULKAN_SDK}/../source/VulkanTools/cmake")
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
list(APPEND CMAKE_MODULE_PATH "$ENV{VULKAN_SDK}/Samples/cmake")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
message(WARNING "Failed to find vulkan since cmake too old\n"
message(WARNING "Failed to find vulkan since cmake is too old\n"
"cmake >= 3.7 required. Consider `brew upgrade cmake`")
endif()
else()
message(FATAL_ERROR "!! CMake didn't find Vulkan. Please set VULKAN_SDK env var, e.g.:\n"
message(FATAL_ERROR "Error: CMake didn't find Vulkan. Please set VULKAN_SDK env var, e.g.:\n"
"Linux: export VULKAN_SDK=~/soft/vulkansdk/1.2.148.0/x86_64\n"
"Windows: set VULKAN_SDK=E:/lib/VulkanSDK/1.2.148.0\n"
"MacOS: export VULKAN_SDK=~/soft/vulkansdk/1.2.148.0/macOS\n"
Expand All @@ -296,7 +295,7 @@ if(NCNN_VULKAN)
find_library(Metal NAMES Metal)
find_library(IOKit NAMES IOKit)
find_library(IOSurface NAMES IOSurface)
list(APPEND vulkan_dependec_LINK_LIBRARIES
list(APPEND vulkan_dependent_LINK_LIBRARIES
${Metal}
${IOKit}
${IOSurface}
Expand All @@ -306,7 +305,7 @@ if(NCNN_VULKAN)
${Foundation}
${CoreFoundation}
)
target_link_libraries(ncnn PRIVATE ${vulkan_dependec_LINK_LIBRARIES})
target_link_libraries(ncnn PRIVATE ${vulkan_dependent_LINK_LIBRARIES})
endif()
target_include_directories(ncnn PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>)
target_link_libraries(ncnn PRIVATE glslang SPIRV)
Expand Down

0 comments on commit cbd838f

Please sign in to comment.