Skip to content

Commit 12cbbc6

Browse files
authored
Fix compile error in android (KomputeProject#423)
Signed-off-by: zlaazlaa <[email protected]>
1 parent 9e4c3e3 commit 12cbbc6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ endif()
135135
# Has to happen AFTER using the build-in Vulkan headers to prevent multiple targets with the name Vulkan::Headers
136136
if(KOMPUTE_OPT_ANDROID_BUILD)
137137
add_library(vulkanAndroid INTERFACE)
138-
set(VULKAN_INCLUDE_DIR ${ANDROID_NDK}/sources/third_party/vulkan/src/include)
138+
if(NOT DEFINED VULKAN_INCLUDE_DIR)
139+
message(FATAL_ERROR "VULKAN_INCLUDE_DIR is not set. Please set it to the Vulkan SDK include directory.")
140+
endif()
139141
target_sources(vulkanAndroid INTERFACE ${VULKAN_INCLUDE_DIR}/vulkan/vulkan.hpp)
140142
target_include_directories(vulkanAndroid INTERFACE ${VULKAN_INCLUDE_DIR})
141143

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if(KOMPUTE_OPT_BUILD_PYTHON)
8282
target_link_libraries(kompute PRIVATE pybind11::headers ${PYTHON_LIBRARIES})
8383
endif()
8484

85-
if(KOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER)
85+
if(NOT KOMPUTE_OPT_ANDROID_BUILD AND KOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER)
8686
target_link_libraries(kompute PUBLIC Vulkan-Headers)
8787
endif()
8888

0 commit comments

Comments
 (0)