mirror of
https://gitee.com/openharmony/third_party_vulkan-loader
synced 2025-02-17 06:07:51 +00:00
loader: set DEFAULT_VK_{DRIVER,LAYER}S_PATH to "" on Linux
When loader_get_fullpath() gets an empty string as the 'dir' parameter, it immediately writes out the original, unexpanded filename. Setting the default drivers and layers paths to an empty string on Linux will allow the unmodified filenames to be passed to dlopen(3) without having to maintain a separate code path for Windows. Now that there is no longer a default path for drivers or layers on Linux, ${CMAKE_INSTALL_LIBDIR} no longer needs to be baked into the loader binary. Note that any ICDs or layers that are currently getting installed to the previous default paths (e.g. /usr/lib/vulkan/icd or /usr/lib/vulkanlayer) will not be discoverable when specified as plain filenames, unless these directories happen to be configured in the loader's search path on the system in question.
This commit is contained in:
parent
799f82260e
commit
eafe35ecbc
@ -60,7 +60,6 @@ endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
include(GNUInstallDirs)
|
||||
add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}")
|
||||
add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_SYSCONFDIR}")
|
||||
add_definitions(-DDATADIR="${CMAKE_INSTALL_DATADIR}")
|
||||
if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
|
||||
|
@ -62,38 +62,28 @@
|
||||
#define LOCAL_DRIVERS_INFO \
|
||||
LOCALPREFIX "/" SYSCONFDIR VULKAN_ICDCONF_DIR ":" \
|
||||
LOCALPREFIX "/" DATADIR VULKAN_ICDCONF_DIR ":"
|
||||
#define LOCAL_DRIVERS_PATH \
|
||||
LOCALPREFIX "/" LIBDIR VULKAN_ICD_DIR ":"
|
||||
#define LOCAL_LAYERS_INFO \
|
||||
LOCALPREFIX "/" SYSCONFDIR VULKAN_ELAYERCONF_DIR ":" \
|
||||
LOCALPREFIX "/" SYSCONFDIR VULKAN_ILAYERCONF_DIR ":" \
|
||||
LOCALPREFIX "/" DATADIR VULKAN_ELAYERCONF_DIR ":" \
|
||||
LOCALPREFIX "/" DATADIR VULKAN_ILAYERCONF_DIR ":"
|
||||
#define LOCAL_LAYERS_PATH \
|
||||
LOCALPREFIX "/" LIBDIR VULKAN_LAYER_DIR ":"
|
||||
#else
|
||||
#define LOCAL_DRIVERS_INFO
|
||||
#define LOCAL_DRIVERS_PATH
|
||||
#define LOCAL_LAYERS_INFO
|
||||
#define LOCAL_LAYERS_PATH
|
||||
#endif
|
||||
|
||||
#define DEFAULT_VK_DRIVERS_INFO \
|
||||
LOCAL_DRIVERS_INFO \
|
||||
"/" SYSCONFDIR VULKAN_ICDCONF_DIR ":" \
|
||||
"/usr/" DATADIR VULKAN_ICDCONF_DIR
|
||||
#define DEFAULT_VK_DRIVERS_PATH \
|
||||
LOCAL_DRIVERS_PATH \
|
||||
"/usr/" LIBDIR VULKAN_ICD_DIR
|
||||
#define DEFAULT_VK_DRIVERS_PATH ""
|
||||
#define DEFAULT_VK_LAYERS_INFO \
|
||||
LOCAL_LAYERS_INFO \
|
||||
"/" SYSCONFDIR VULKAN_ELAYERCONF_DIR ":" \
|
||||
"/" SYSCONFDIR VULKAN_ILAYERCONF_DIR ":" \
|
||||
"/usr/" DATADIR VULKAN_ELAYERCONF_DIR ":" \
|
||||
"/usr/" DATADIR VULKAN_ILAYERCONF_DIR
|
||||
#define DEFAULT_VK_LAYERS_PATH \
|
||||
LOCAL_LAYERS_PATH \
|
||||
"/usr/" LIBDIR VULKAN_LAYER_DIR
|
||||
#define DEFAULT_VK_LAYERS_PATH ""
|
||||
#define LAYERS_PATH_ENV "VK_LAYER_PATH"
|
||||
|
||||
// C99:
|
||||
|
Loading…
x
Reference in New Issue
Block a user