aboutsummaryrefslogtreecommitdiff
path: root/loader
diff options
context:
space:
mode:
Diffstat (limited to 'loader')
-rw-r--r--loader/CMakeLists.txt3
-rw-r--r--loader/vk_loader_platform.h12
2 files changed, 11 insertions, 4 deletions
diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index 816e4114..6282bac6 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -180,10 +180,9 @@ if (WIN32)
# Suppress conflicting libs warning for debug builds.
set_target_properties(${API_LOWERCASE}-${MAJOR} PROPERTIES LINK_FLAGS_DEBUG /ignore:4098)
set_target_properties(VKstatic.${MAJOR} PROPERTIES OUTPUT_NAME VKstatic.${MAJOR})
- target_link_libraries(${API_LOWERCASE}-${MAJOR} shlwapi Cfgmgr32)
+ target_link_libraries(${API_LOWERCASE}-${MAJOR} Cfgmgr32)
add_dependencies(${API_LOWERCASE}-${MAJOR} generate_helper_files loader_gen_files loader_asm_gen_files)
- target_link_libraries(VKstatic.${MAJOR} shlwapi)
if (CMAKE_GENERATOR MATCHES "^Visual Studio.*")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${API_LOWERCASE}-${MAJOR}.dll COPY_SRC_PATH)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/../demos/$<CONFIGURATION>/ COPY_DST_PATH)
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
index 40de844e..505cb1e2 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
@@ -222,7 +222,15 @@ static bool loader_platform_file_exists(const char *path) {
return true;
}
-static bool loader_platform_is_path_absolute(const char *path) { return !PathIsRelative(path); }
+static bool loader_platform_is_path_absolute(const char *path) {
+ if (!path || !*path) {
+ return false;
+ }
+ if (*path == DIRECTORY_SYMBOL || path[1] == ':') {
+ return true;
+ }
+ return false;
+}
// WIN32 runtime doesn't have dirname().
static inline char *loader_platform_dirname(char *path) {
@@ -273,7 +281,7 @@ typedef HMODULE loader_platform_dl_handle;
static loader_platform_dl_handle loader_platform_open_library(const char *lib_path) {
// Try loading the library the original way first.
loader_platform_dl_handle lib_handle = LoadLibrary(lib_path);
- if (lib_handle == NULL && GetLastError() == ERROR_MOD_NOT_FOUND && PathFileExists(lib_path)) {
+ if (lib_handle == NULL && GetLastError() == ERROR_MOD_NOT_FOUND) {
// If that failed, then try loading it with broader search folders.
lib_handle = LoadLibraryEx(lib_path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
}