Commit 9746f8bf by Jamie Madill

Fix GN/Chromium build.

This fixes the GN header check with Yarn. Enables further ANGLE integration. Also fixes a number of MSVC build errors and changes the output name of the Vulkan ICD on Windows to "vk_swiftshader" so that it matches the .def file used in CMake. Bug: angleproject:3876 Bug: b/140251624 Change-Id: Ie23ba965a2ee7f8b678499db22d6614f0a6666fa Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36009Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 60a0dc70
...@@ -51,6 +51,13 @@ config("swiftshader_config") { ...@@ -51,6 +51,13 @@ config("swiftshader_config") {
if (!is_debug) { if (!is_debug) {
defines += [ "ANGLE_DISABLE_TRACE" ] defines += [ "ANGLE_DISABLE_TRACE" ]
} }
# Diable some MSVC warnings.
if (!is_clang) {
cflags += [
"/wd4309", # Truncation of constant value. See PixelRoutine.cpp casts of signed shorts.
]
}
} else { } else {
cflags = [ cflags = [
"-std=c++11", "-std=c++11",
......
...@@ -25,8 +25,11 @@ declare_args() { ...@@ -25,8 +25,11 @@ declare_args() {
config("swiftshader_reactor_private_config") { config("swiftshader_reactor_private_config") {
if (is_win) { if (is_win) {
cflags = [ cflags = [
"/wd4141", # 'inline' used more than once. (LLVM 7.0)
"/wd4146", # unary minus operator applied to unsigned type. (LLVM 7.0)
"/wd4201", # nameless struct/union "/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm) "/wd4245", # conversion from int to unsigned int (llvm)
"/wd4624", # destructor was implicitly defined as deleted (LLVM 7.0)
] ]
} else { } else {
cflags = [ "-Wno-unused-local-typedef" ] cflags = [ "-Wno-unused-local-typedef" ]
......
...@@ -36,10 +36,12 @@ config("swiftshader_libvulkan_private_config") { ...@@ -36,10 +36,12 @@ config("swiftshader_libvulkan_private_config") {
defines = [ "VK_EXPORT=" ] defines = [ "VK_EXPORT=" ]
} }
if (is_clang) {
cflags = [ cflags = [
"-Wno-unused-private-field", "-Wno-unused-private-field",
"-Wno-switch", "-Wno-switch",
] ]
}
} }
swiftshader_source_set("swiftshader_libvulkan_headers") { swiftshader_source_set("swiftshader_libvulkan_headers") {
...@@ -120,7 +122,12 @@ swiftshader_shared_library("swiftshader_libvulkan") { ...@@ -120,7 +122,12 @@ swiftshader_shared_library("swiftshader_libvulkan") {
configs = [ ":swiftshader_libvulkan_private_config" ] configs = [ ":swiftshader_libvulkan_private_config" ]
# TODO(capn): Use the same ICD name on both Windows and non-Windows.
if (is_win) {
output_name = "vk_swiftshader"
} else {
output_name = "libvk_swiftshader" output_name = "libvk_swiftshader"
}
if (!is_fuchsia) { if (!is_fuchsia) {
# NOTE: Work-around for http://crbug.com/1000668 # NOTE: Work-around for http://crbug.com/1000668
output_dir = "$root_out_dir/swiftshader" output_dir = "$root_out_dir/swiftshader"
......
...@@ -42,6 +42,14 @@ swiftshader_source_set("Yarn_headers") { ...@@ -42,6 +42,14 @@ swiftshader_source_set("Yarn_headers") {
if (is_win) { if (is_win) {
sources += [ "OSFiber_windows.hpp" ] sources += [ "OSFiber_windows.hpp" ]
} else {
sources += [
"OSFiber_asm.hpp",
"OSFiber_asm_aarch64.h",
"OSFiber_asm_arm.h",
"OSFiber_asm_x64.h",
"OSFiber_asm_x86.h",
]
} }
public_configs = [ public_configs = [
...@@ -61,15 +69,10 @@ swiftshader_source_set("Yarn") { ...@@ -61,15 +69,10 @@ swiftshader_source_set("Yarn") {
sources += [ sources += [
"OSFiber_aarch64.c", "OSFiber_aarch64.c",
"OSFiber_arm.c", "OSFiber_arm.c",
"OSFiber_asm.hpp",
"OSFiber_asm_aarch64.S", "OSFiber_asm_aarch64.S",
"OSFiber_asm_aarch64.h",
"OSFiber_asm_arm.S", "OSFiber_asm_arm.S",
"OSFiber_asm_arm.h",
"OSFiber_asm_x64.S", "OSFiber_asm_x64.S",
"OSFiber_asm_x64.h",
"OSFiber_asm_x86.S", "OSFiber_asm_x86.S",
"OSFiber_asm_x86.h",
"OSFiber_x64.c", "OSFiber_x64.c",
"OSFiber_x86.c", "OSFiber_x86.c",
] ]
...@@ -97,4 +100,11 @@ test("yarn_unittests") { ...@@ -97,4 +100,11 @@ test("yarn_unittests") {
"//testing/gtest", "//testing/gtest",
"//testing/gmock", "//testing/gmock",
] ]
if (!swiftshader_standalone) {
deps += [
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
} }
...@@ -22,6 +22,7 @@ config("swiftshader_llvm_private_config") { ...@@ -22,6 +22,7 @@ config("swiftshader_llvm_private_config") {
cflags += [ cflags += [
"/wd4005", "/wd4005",
"/wd4065", "/wd4065",
"/wd4141",
"/wd4146", "/wd4146",
"/wd4245", "/wd4245",
"/wd4267", "/wd4267",
...@@ -35,6 +36,8 @@ config("swiftshader_llvm_private_config") { ...@@ -35,6 +36,8 @@ config("swiftshader_llvm_private_config") {
"/wd4703", "/wd4703",
"/wd4706", "/wd4706",
"/wd4800", "/wd4800",
"/wd4805",
"/wd4828",
] ]
if (!is_debug) { if (!is_debug) {
...@@ -55,22 +58,21 @@ config("swiftshader_llvm_private_config") { ...@@ -55,22 +58,21 @@ config("swiftshader_llvm_private_config") {
} }
if (is_clang) { if (is_clang) {
cflags += [ "-Wno-header-hygiene" ]
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [ "-msse2" ]
}
}
cflags += [ cflags += [
"-Wno-attributes", "-Wno-attributes",
"-Wno-deprecated-declarations", "-Wno-deprecated-declarations",
"-Wno-enum-compare", "-Wno-enum-compare",
"-Wno-header-hygiene",
"-Wno-unused-function", "-Wno-unused-function",
"-Wno-unused-local-typedef", "-Wno-unused-local-typedef",
"-Wno-unused-private-field", "-Wno-unused-private-field",
"-Wno-unused-result", "-Wno-unused-result",
"-Wno-unused-variable", "-Wno-unused-variable",
] ]
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [ "-msse2" ]
}
}
defines = [ defines = [
"__STDC_CONSTANT_MACROS", "__STDC_CONSTANT_MACROS",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment