Skip to content

Commit c11e14f

Browse files
committed
CMake (Android): set rpath for system Android libs
So that Vulkan & OpenCL can find them
1 parent ab6a770 commit c11e14f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,14 @@ else()
11421142
endif()
11431143
endif()
11441144

1145+
if(ANDROID)
1146+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
1147+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/vendor/lib64 -Wl,-rpath,/system/lib64")
1148+
else()
1149+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/vendor/lib -Wl,-rpath,/system/lib")
1150+
endif()
1151+
endif()
1152+
11451153
if(LINUX AND EXISTS "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1")
11461154
execute_process(COMMAND "/lib/ld-musl-${CMAKE_HOST_SYSTEM_PROCESSOR}.so.1"
11471155
ERROR_VARIABLE LD_MUSL_RESULT)

src/detection/vulkan/vulkan.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,7 @@ static void applyDriverName(VkPhysicalDeviceDriverPropertiesKHR* properties, FFs
4040
static const char* detectVulkan(FFVulkanResult* result)
4141
{
4242
FF_LIBRARY_LOAD(vulkan, "dlopen libvulkan" FF_LIBRARY_EXTENSION " failed",
43-
#if __ANDROID__
44-
#if UINTPTR_MAX == UINT32_MAX
45-
"/system/lib/"
46-
#else
47-
"/system/lib64/"
48-
#endif
49-
"libvulkan" FF_LIBRARY_EXTENSION, -1
50-
#elif __APPLE__
43+
#if __APPLE__
5144
"libMoltenVK" FF_LIBRARY_EXTENSION, -1
5245
#elif _WIN32
5346
"vulkan-1" FF_LIBRARY_EXTENSION, -1

0 commit comments

Comments
 (0)