-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy path007-vulkan-loader-updates.patch
69 lines (66 loc) · 1.97 KB
/
007-vulkan-loader-updates.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --git a/BUILD.gn b/BUILD.gn
index 7bbd39316..45f0d588c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -80,7 +80,7 @@ config("vulkan_loader_config") {
"LOADER_USE_UNSAFE_FILE_SEARCH=1",
]
- if (is_win) {
+ if (is_msvs) {
cflags = [ "/wd4201" ]
}
if (is_linux || is_chromeos) {
@@ -146,7 +146,7 @@ if (!is_android) {
if (custom_vulkan_loader_library_name != "") {
output_name = custom_vulkan_loader_library_name
} else {
- if (is_win) {
+ if (is_msvs) {
output_name = "vulkan-1"
} else {
output_name = "vulkan"
@@ -164,10 +164,14 @@ if (!is_android) {
"loader/dirent_on_windows.h",
"loader/loader_windows.c",
"loader/loader_windows.h",
- "loader/loader.rc",
- "loader/vulkan-1.def",
]
- if (!is_clang) {
+ if (vulkan_loader_shared) {
+ sources += [
+ "loader/loader.rc",
+ "loader/vulkan-1.def",
+ ]
+ }
+ if (is_msvs && !is_clang) {
cflags = [
"/wd4054", # Type cast from function pointer
"/wd4055", # Type cast from data pointer
@@ -186,7 +190,7 @@ if (!is_android) {
if (is_clang) {
cflags = [ "-Wno-incompatible-pointer-types" ]
}
- libs = [ "Cfgmgr32.lib" ]
+ libs = [ "cfgmgr32" ]
}
if (is_linux || is_chromeos) {
sources += [
diff --git a/loader/loader_windows.c b/loader/loader_windows.c
index f9f2ddae8..1a0d999d7 100644
--- a/loader/loader_windows.c
+++ b/loader/loader_windows.c
@@ -95,6 +95,7 @@ void windows_initialization(void) {
#endif
}
+#ifndef BUILD_STATIC_LOADER
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
(void)hinst;
switch (reason) {
@@ -112,6 +113,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
}
return TRUE;
}
+#endif
bool windows_add_json_entry(const struct loader_instance *inst,
char **reg_data, // list of JSON files