Commit d6d10f96 by Alexis Hetu Committed by Alexis Hétu

Fixed official chromium build on Linux

A warning treated as an error was causing the official build to fail. Added -Wno-unused-result to the LLVM build file to solve the issue. Also ran 'git cl format' on the BUILD.gn files to fix all formatting issues. Change-Id: I235c7d9d3e60f788e1dc694a40991c214e6c77e3 Reviewed-on: https://swiftshader-review.googlesource.com/8110Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent b9dda64e
......@@ -15,18 +15,18 @@
config("swiftshader_config") {
if (is_win) {
cflags = [
"/GS", # Detects some buffer overruns
"/GS", # Detects some buffer overruns
"/Zc:wchar_t",
"/D_CRT_SECURE_NO_DEPRECATE",
"/DNOMINMAX",
"/D_WINDLL",
"/EHsc",
"/nologo",
"/Gd", # Default calling convention
"/Gd", # Default calling convention
]
if (is_debug) {
cflags += [ "/RTC1" ] # Run-Time Error Checks
cflags += [ "/RTC1" ] # Run-Time Error Checks
} else {
cflags += [ "/DANGLE_DISABLE_TRACE" ]
}
......@@ -35,7 +35,7 @@ config("swiftshader_config") {
if (is_debug) {
cflags += [ "-g" ]
} else { # Release
} else { # Release
# All Release builds use function/data sections to make the shared libraries smaller
cflags += [
"-ffunction-sections",
......@@ -47,17 +47,17 @@ config("swiftshader_config") {
# Choose the right Release architecture
if (target_cpu == "x64") {
cflags += [ "-march=core2" ]
} else { # 32
} else { # 32
cflags += [ "-march=i686" ]
}
}
if (target_cpu == "x64") { # 64 bit version
if (target_cpu == "x64") { # 64 bit version
cflags += [
"-m64",
"-fPIC",
]
} else { # 32 bit version
} else { # 32 bit version
cflags += [ "-m32" ]
}
}
......@@ -76,4 +76,4 @@ group("swiftshader_tests") {
data_deps = [
"tests/unittests:swiftshader_unittests",
]
}
\ No newline at end of file
}
......@@ -15,7 +15,7 @@
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_common_private_config") {
if (is_win) {
cflags = [ "/wd4201" ] # nameless struct/union
cflags = [ "/wd4201" ] # nameless struct/union
} else {
cflags = [
"-DLOG_TAG=\"swiftshader_common\"",
......@@ -39,4 +39,4 @@ source_set("swiftshader_common") {
]
configs += [ ":swiftshader_common_private_config" ]
}
\ No newline at end of file
}
......@@ -15,7 +15,7 @@
# Need a separate config to ensure the warnings are added to the end.
config("swiftshader_main_private_config") {
if (is_win) {
cflags = [ "/wd4201" ] # nameless struct/union
cflags = [ "/wd4201" ] # nameless struct/union
if (is_clang) {
cflags += [
......@@ -32,7 +32,9 @@ config("swiftshader_main_private_config") {
}
source_set("swiftshader_main") {
deps = [ "../Common:swiftshader_common" ]
deps = [
"../Common:swiftshader_common",
]
sources = [
"Config.cpp",
......@@ -42,8 +44,8 @@ source_set("swiftshader_main") {
if (is_linux) {
sources += [
"libX11.cpp",
"FrameBufferX11.cpp",
"libX11.cpp",
]
} else if (is_mac) {
sources += [ "FrameBufferOSX.mm" ]
......@@ -57,8 +59,9 @@ source_set("swiftshader_main") {
if (is_win) {
configs -= [ "//build/config/win:unicode" ]
libs = [ "dxguid.lib" ] # For FrameBufferDD
libs = [ "dxguid.lib" ] # For FrameBufferDD
}
configs += [ ":swiftshader_main_private_config" ]
include_dirs = [
......@@ -70,7 +73,7 @@ source_set("swiftshader_main") {
include_dirs += [ "../../include" ]
libs = [
"Quartz.framework",
"Cocoa.framework"
"Cocoa.framework",
]
}
}
\ No newline at end of file
}
......@@ -16,8 +16,8 @@
config("swiftshader_opengl_common_private_config") {
if (is_win) {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
} else {
cflags = [ "-DLOG_TAG=\"swiftshader_opengl_common\"" ]
......@@ -26,10 +26,10 @@ config("swiftshader_opengl_common_private_config") {
source_set("swiftshader_opengl_common") {
sources = [
"debug.cpp",
"Image.cpp",
"Object.cpp",
"MatrixStack.cpp",
"Object.cpp",
"debug.cpp",
]
configs += [ ":swiftshader_opengl_common_private_config" ]
......@@ -39,4 +39,4 @@ source_set("swiftshader_opengl_common") {
"../..",
"../../../include",
]
}
\ No newline at end of file
}
......@@ -16,14 +16,14 @@
config("swiftshader_opengl_compiler_private_config") {
if (is_win) {
cflags = [
"/wd4005", # macro redefinition (in autogenerated code)
"/wd4201", # nameless struct/union
"/wd4267", # conversion from size_t to int/unsigned int
"/wd4702", # unreachable code (in autogenerated code)
"/wd4005", # macro redefinition (in autogenerated code)
"/wd4201", # nameless struct/union
"/wd4267", # conversion from size_t to int/unsigned int
"/wd4702", # unreachable code (in autogenerated code)
]
if (!is_debug) {
cflags += [ "/wd4189" ] # local variable is initialized but not referenced (variables only used in ASSERTS)
cflags += [ "/wd4189" ] # local variable is initialized but not referenced (variables only used in ASSERTS)
}
} else {
cflags = [
......@@ -32,38 +32,40 @@ config("swiftshader_opengl_compiler_private_config") {
]
if (!is_debug) {
cflags += [ "-Wno-unused-variable" ] # local variable is initialized but not referenced (variables only used in ASSERTS)
cflags += [ "-Wno-unused-variable" ] # local variable is initialized but not referenced (variables only used in ASSERTS)
}
}
}
source_set("swiftshader_opengl_compiler") {
deps = [ "preprocessor:swiftshader_opengl_preprocessor" ]
deps = [
"preprocessor:swiftshader_opengl_preprocessor",
]
sources = [
"AnalyzeCallDepth.cpp",
"Compiler.cpp",
"debug.cpp",
"Diagnostics.cpp",
"DirectiveHandler.cpp",
"glslang_lex.cpp",
"glslang_tab.cpp",
"InfoSink.cpp",
"Initialize.cpp",
"InitializeParseContext.cpp",
"IntermTraverse.cpp",
"Intermediate.cpp",
"intermOut.cpp",
"OutputASM.cpp",
"parseConst.cpp",
"ParseHelper.cpp",
"PoolAlloc.cpp",
"SymbolTable.cpp",
"TranslatorASM.cpp",
"util.cpp",
"ValidateGlobalInitializer.cpp",
"ValidateLimitations.cpp",
"ValidateSwitch.cpp",
"debug.cpp",
"glslang_lex.cpp",
"glslang_tab.cpp",
"intermOut.cpp",
"parseConst.cpp",
"util.cpp",
]
if (is_linux || is_mac) {
......@@ -79,4 +81,4 @@ source_set("swiftshader_opengl_compiler") {
"../..",
"../../../include",
]
}
\ No newline at end of file
}
......@@ -16,14 +16,12 @@
config("swiftshader_opengl_preprocessor_private_config") {
if (is_win) {
cflags = [
"/wd4005", # macro redefinition (in autogenerated code)
"/wd4267", # conversion from size_t to int/unsigned int (in autogenerated code)
"/wd4702", # unreachable code (in autogenerated code)
"/wd4005", # macro redefinition (in autogenerated code)
"/wd4267", # conversion from size_t to int/unsigned int (in autogenerated code)
"/wd4702", # unreachable code (in autogenerated code)
]
} else {
cflags = [
"-DLOG_TAG=\"swiftshader_opengl_compiler\"",
]
cflags = [ "-DLOG_TAG=\"swiftshader_opengl_compiler\"" ]
}
}
......@@ -42,7 +40,5 @@ source_set("swiftshader_opengl_preprocessor") {
"Tokenizer.cpp",
]
configs += [
":swiftshader_opengl_preprocessor_private_config",
]
}
\ No newline at end of file
configs += [ ":swiftshader_opengl_preprocessor_private_config" ]
}
......@@ -19,8 +19,8 @@ config("swiftshader_libEGL_private_config") {
"/DEGLAPI=",
"/DEGL_EGLEXT_PROTOTYPES",
"/DLIBEGL_EXPORTS",
"/wd4201", # nameless struct/union
"/wd4065", # switch statement contains 'default' but no 'case' labels
"/wd4201", # nameless struct/union
"/wd4065", # switch statement contains 'default' but no 'case' labels
]
} else {
cflags = [
......@@ -39,18 +39,18 @@ shared_library("swiftshader_libEGL") {
}
sources = [
"../common/Object.cpp",
"Config.cpp",
"Display.cpp",
"Surface.cpp",
"libEGL.cpp",
"main.cpp",
"../common/Object.cpp",
"libEGL.def",
"libEGL.rc",
"main.cpp",
"resource.h",
]
if(is_debug) {
if (is_debug) {
sources += [ "../common/debug.cpp" ]
}
......@@ -79,4 +79,4 @@ shared_library("swiftshader_libEGL") {
"../..",
"..",
]
}
\ No newline at end of file
}
......@@ -20,12 +20,11 @@ config("swiftshader_libGLESv2_private_config") {
"/DGL_APICALL=",
"/DGL_GLEXT_PROTOTYPES",
"/DLIBGLESV2_EXPORTS",
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
if (is_clang)
{
if (is_clang) {
cflags += [
"-D__STDC_CONSTANT_MACROS",
"-D__STDC_LIMIT_MACROS",
......@@ -63,9 +62,6 @@ shared_library("swiftshader_libGLESv2") {
"Fence.cpp",
"Framebuffer.cpp",
"IndexDataManager.cpp",
"libGLESv2.cpp",
"libGLESv3.cpp",
"main.cpp",
"Program.cpp",
"Query.cpp",
"Renderbuffer.cpp",
......@@ -73,12 +69,15 @@ shared_library("swiftshader_libGLESv2") {
"Shader.cpp",
"Texture.cpp",
"TransformFeedback.cpp",
"utilities.cpp",
"VertexArray.cpp",
"VertexDataManager.cpp",
"libGLESv2.cpp",
"libGLESv2.def",
"libGLESv2.rc",
"libGLESv3.cpp",
"main.cpp",
"resource.h",
"utilities.cpp",
]
if (is_win) {
......@@ -98,4 +97,4 @@ shared_library("swiftshader_libGLESv2") {
"../..",
"..",
]
}
\ No newline at end of file
}
......@@ -16,8 +16,8 @@
config("swiftshader_reactor_private_config") {
if (is_win) {
cflags = [
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
]
} else {
cflags = [
......@@ -32,15 +32,15 @@ config("swiftshader_reactor_private_config") {
source_set("swiftshader_reactor") {
deps = [
"../OpenGL/common:swiftshader_opengl_common",
"../../third_party/LLVM:swiftshader_llvm",
"../OpenGL/common:swiftshader_opengl_common",
]
sources = [
"LLVMReactor.cpp",
"Routine.cpp",
"LLVMRoutine.cpp",
"LLVMRoutineManager.cpp",
"Routine.cpp",
]
if (is_win) {
......@@ -54,4 +54,4 @@ source_set("swiftshader_reactor") {
"../Common",
"../../third_party/LLVM/include/",
]
}
\ No newline at end of file
}
......@@ -16,8 +16,8 @@
config("swiftshader_renderer_private_config") {
if (is_win) {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
} else {
cflags = [
......@@ -29,7 +29,9 @@ config("swiftshader_renderer_private_config") {
}
source_set("swiftshader_renderer") {
deps = [ "../Shader:swiftshader_shader" ]
deps = [
"../Shader:swiftshader_shader",
]
sources = [
"Blitter.cpp",
......@@ -64,4 +66,4 @@ source_set("swiftshader_renderer") {
"../Main",
"../Shader",
]
}
\ No newline at end of file
}
......@@ -16,14 +16,12 @@
config("swiftshader_shader_private_config") {
if (is_win) {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
if (is_clang) {
cflags += [
"-Wno-sign-compare",
]
cflags += [ "-Wno-sign-compare" ]
}
} else {
cflags = [ "-DLOG_TAG=\"swiftshader_shader\"" ]
......@@ -31,7 +29,9 @@ config("swiftshader_shader_private_config") {
}
source_set("swiftshader_shader") {
deps = [ "../Main:swiftshader_main" ]
deps = [
"../Main:swiftshader_main",
]
sources = [
"Constants.cpp",
......@@ -58,4 +58,4 @@ source_set("swiftshader_shader") {
"../Main",
"../Renderer",
]
}
\ No newline at end of file
}
......@@ -15,10 +15,13 @@
import("//testing/test.gni")
test("swiftshader_unittests") {
deps = [
"../../src/OpenGL/libGLESv2:swiftshader_libGLESv2",
deps = [
"../../src/OpenGL/libEGL:swiftshader_libEGL",
"../../src/OpenGL/libGLESv2:swiftshader_libGLESv2",
"//testing/gtest",
]
sources = [ "main.cpp" ]
sources = [
"main.cpp",
]
}
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