70 lines
2.0 KiB
Diff
70 lines
2.0 KiB
Diff
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
|