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") {
if (!is_debug) {
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 {
cflags = [
"-std=c++11",
......
......@@ -25,8 +25,11 @@ declare_args() {
config("swiftshader_reactor_private_config") {
if (is_win) {
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
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4624", # destructor was implicitly defined as deleted (LLVM 7.0)
]
} else {
cflags = [ "-Wno-unused-local-typedef" ]
......
......@@ -36,10 +36,12 @@ config("swiftshader_libvulkan_private_config") {
defines = [ "VK_EXPORT=" ]
}
cflags = [
"-Wno-unused-private-field",
"-Wno-switch",
]
if (is_clang) {
cflags = [
"-Wno-unused-private-field",
"-Wno-switch",
]
}
}
swiftshader_source_set("swiftshader_libvulkan_headers") {
......@@ -120,7 +122,12 @@ swiftshader_shared_library("swiftshader_libvulkan") {
configs = [ ":swiftshader_libvulkan_private_config" ]
output_name = "libvk_swiftshader"
# 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"
}
if (!is_fuchsia) {
# NOTE: Work-around for http://crbug.com/1000668
output_dir = "$root_out_dir/swiftshader"
......
......@@ -42,6 +42,14 @@ swiftshader_source_set("Yarn_headers") {
if (is_win) {
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 = [
......@@ -61,15 +69,10 @@ swiftshader_source_set("Yarn") {
sources += [
"OSFiber_aarch64.c",
"OSFiber_arm.c",
"OSFiber_asm.hpp",
"OSFiber_asm_aarch64.S",
"OSFiber_asm_aarch64.h",
"OSFiber_asm_arm.S",
"OSFiber_asm_arm.h",
"OSFiber_asm_x64.S",
"OSFiber_asm_x64.h",
"OSFiber_asm_x86.S",
"OSFiber_asm_x86.h",
"OSFiber_x64.c",
"OSFiber_x86.c",
]
......@@ -97,4 +100,11 @@ test("yarn_unittests") {
"//testing/gtest",
"//testing/gmock",
]
if (!swiftshader_standalone) {
deps += [
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
}
......@@ -22,6 +22,7 @@ config("swiftshader_llvm_private_config") {
cflags += [
"/wd4005",
"/wd4065",
"/wd4141",
"/wd4146",
"/wd4245",
"/wd4267",
......@@ -35,6 +36,8 @@ config("swiftshader_llvm_private_config") {
"/wd4703",
"/wd4706",
"/wd4800",
"/wd4805",
"/wd4828",
]
if (!is_debug) {
......@@ -55,23 +58,22 @@ config("swiftshader_llvm_private_config") {
}
if (is_clang) {
cflags += [ "-Wno-header-hygiene" ]
cflags += [
"-Wno-attributes",
"-Wno-deprecated-declarations",
"-Wno-enum-compare",
"-Wno-header-hygiene",
"-Wno-unused-function",
"-Wno-unused-local-typedef",
"-Wno-unused-private-field",
"-Wno-unused-result",
"-Wno-unused-variable",
]
if (target_cpu == "x86" || target_cpu == "x64") {
cflags += [ "-msse2" ]
}
}
cflags += [
"-Wno-attributes",
"-Wno-deprecated-declarations",
"-Wno-enum-compare",
"-Wno-unused-function",
"-Wno-unused-local-typedef",
"-Wno-unused-private-field",
"-Wno-unused-result",
"-Wno-unused-variable",
]
defines = [
"__STDC_CONSTANT_MACROS",
"__STDC_LIMIT_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