Skip to content

Commit a82704e

Browse files
committed
mingw fixes 3
1 parent 49dc178 commit a82704e

File tree

2 files changed

+61
-19
lines changed

2 files changed

+61
-19
lines changed

BUILD.gn

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,11 @@ optional("fontmgr_win_gdi") {
497497
public_defines = [ "SK_FONTMGR_GDI_AVAILABLE" ]
498498
public = skia_ports_windows_fonts_public
499499
sources = skia_ports_fonthost_win_sources
500-
libs = [ "Gdi32.lib" ]
500+
if (is_msvc) {
501+
libs = [ "Gdi32.lib" ]
502+
} else {
503+
libs = [ "gdi32" ]
504+
}
501505
}
502506

503507
if (skia_lex) {
@@ -898,7 +902,31 @@ optional("gpu_shared") {
898902

899903
if (skia_use_dawn) {
900904
public_defines += [ "SK_DAWN" ]
901-
public_deps += [ "//third_party/dawn" ]
905+
906+
# When building for WASM, the WebGPU headers are provided by Emscripten. For native builds we
907+
# have to depend on Dawn directly.
908+
if (!skia_use_webgpu) {
909+
public_deps += [
910+
"//third_party/externals/dawn/include/dawn:cpp_headers",
911+
"//third_party/externals/dawn/src/dawn:cpp",
912+
"//third_party/externals/dawn/src/dawn:proc",
913+
]
914+
915+
if (dawn_enable_d3d12 || dawn_enable_d3d11 || dawn_enable_desktop_gl ||
916+
dawn_enable_metal || dawn_enable_opengles || dawn_enable_vulkan) {
917+
public_deps += [ "//third_party/externals/dawn/src/dawn/native" ]
918+
}
919+
if (dawn_enable_d3d12) {
920+
if (is_msvc) {
921+
libs += ["d3d12.lib", "dxgi.lib", "d3dcompiler.lib"]
922+
} else {
923+
libs += ["d3d12", "dxgi", "d3dcompiler"]
924+
}
925+
926+
} else if (dawn_enable_metal) {
927+
frameworks += [ "Metal.framework" ]
928+
}
929+
}
902930
}
903931

904932
if (skia_use_direct3d) {
@@ -1001,7 +1029,12 @@ optional("gpu") {
10011029
"src/gpu/ganesh/gl/win/GrGLMakeWinInterface.cpp",
10021030
]
10031031
if (target_cpu != "arm64") {
1004-
libs += [ "OpenGL32.lib" ]
1032+
if (is_msvc) {
1033+
libs += [ "OpenGL32.lib" ]
1034+
} else {
1035+
libs += [ "opengl32" ]
1036+
}
1037+
10051038
}
10061039
} else {
10071040
sources += [ "src/gpu/ganesh/gl/GrGLMakeNativeInterface_none.cpp" ]
@@ -1026,11 +1059,19 @@ optional("gpu") {
10261059
if (skia_enable_direct3d_debug_layer) {
10271060
public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
10281061
}
1029-
libs += [
1030-
"d3d12.lib",
1031-
"dxgi.lib",
1032-
"d3dcompiler.lib",
1033-
]
1062+
if(is_msvc) {
1063+
libs += [
1064+
"d3d12.lib",
1065+
"dxgi.lib",
1066+
"d3dcompiler.lib",
1067+
]
1068+
} else {
1069+
libs += [
1070+
"d3d12",
1071+
"dxgi",
1072+
"d3dcompiler",
1073+
]
1074+
}
10341075
}
10351076

10361077
cflags_objcc = []
@@ -1760,17 +1801,18 @@ skia_component("skia") {
17601801
"src/ports/SkDebug_win.cpp",
17611802
"src/ports/SkImageGeneratorWIC.cpp",
17621803
]
1763-
libs += [
1764-
"Ole32.lib",
1765-
"OleAut32.lib",
1766-
]
1767-
1804+
if(is_msvc) {
1805+
libs += ["Ole32.lib","OleAut32.lib"]
1806+
} else {
1807+
libs += ["ole32","oleaut32"]
1808+
}
17681809
if (!skia_enable_winuwp) {
1769-
libs += [
1770-
"FontSub.lib",
1771-
"User32.lib",
1772-
"Usp10.lib",
1773-
]
1810+
if(is_msvc) {
1811+
libs += ["FontSub.lib", "User32.lib", "Usp10.lib"]
1812+
} else {
1813+
libs += ["fontsub", "user32", "usp10"]
1814+
}
1815+
17741816
}
17751817
} else {
17761818
sources += [ "src/ports/SkOSFile_posix.cpp" ]

gn/BUILDCONFIG.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ if (is_msvc) {
173173
if (win_toolchain_version == "") {
174174
win_toolchain_version = exec_script("//gn/highest_version_dir.py",
175175
[
176-
"$win_vc/Tools/MSVC",
176+
"$win_vc/tools/msvc",
177177
"[0-9]{2}\.[0-9]{2}\.[0-9]{5}",
178178
],
179179
"trim string")

0 commit comments

Comments
 (0)