aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2015-07-23 16:29:26 -0400
committerJon Ashburn <jon@lunarg.com>2015-07-24 13:08:22 -0600
commit10557bc9196f310d7e58fb67d0b234e341d2763a (patch)
tree0cf051f0fe0f96473cc07507d0784c2436b49398
parent4d2141e6705909a469c84a07d09ca9eb750c0f11 (diff)
downloadusermoji-10557bc9196f310d7e58fb67d0b234e341d2763a.tar.xz
linux: Use standard GNU install paths
These should get inherited from the build environment, which should handle the variation between /usr/lib/$triple on debian vs /usr/lib{,64} on redhat. Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--CMakeLists.txt5
-rw-r--r--loader/vk_loader_platform.h17
2 files changed, 17 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5c63c6b..47816fe3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,11 @@ if(NOT EXISTS ${GLSLANG_PREFIX})
endif()
if(NOT WIN32)
+ include(GNUInstallDirs)
+ add_definitions(-DLIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}")
+ add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
+ add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}")
+
if(NOT EXISTS ${LUNARGLASS_PREFIX})
message(FATAL_ERROR "Necessary LunarGLASS components do not exist: " ${LUNARGLASS_PREFIX})
endif()
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
index 4e586075..f79a61d4 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
@@ -51,11 +51,18 @@
#define PATH_SEPERATOR ':'
#define DIRECTORY_SYMBOL '/'
-// TODO: Need to handle different Linux distros
-#define DEFAULT_VK_DRIVERS_INFO "/etc/vulkan/icd.d:/usr/share/vulkan/icd.d"
-#define DEFAULT_VK_DRIVERS_PATH "/usr/lib/i386-linux-gnu/vulkan/icd:/usr/lib/x86_64-linux-gnu/vulkan/icd"
-#define DEFAULT_VK_LAYERS_INFO "/etc/vulkan/explicit_layer.d:/etc/vulkan/implicit_layer.d:/usr/share/vulkan/explicit_layer.d:/usr/share/vulkan/implicit_layer.d"
-#define DEFAULT_VK_LAYERS_PATH "/usr/lib/i386-linux-gnu/vulkan/layer:/usr/lib/x86_64-linux-gnu/vulkan/layer"
+#define DEFAULT_VK_DRIVERS_INFO \
+ SYSCONFDIR "/vulkan/icd.d:" \
+ DATADIR "/vulkan/icd.d"
+#define DEFAULT_VK_DRIVERS_PATH \
+ LIBDIR "/vulkan/icd"
+#define DEFAULT_VK_LAYERS_INFO \
+ SYSCONFDIR "/vulkan/explicit_layer.d:" \
+ SYSCONFDIR "/vulkan/implicit_layer.d:" \
+ DATADIR "/vulkan/explicit_layer.d:" \
+ DATADIR "/vulkan/implicit_layer.d"
+#define DEFAULT_VK_LAYERS_PATH \
+ LIBDIR "/vulkan/layer"
#define LAYERS_PATH_ENV "VK_LAYER_DIRS"
// C99: