Commit 46c1b917 by Alexis Hetu Committed by Alexis Hétu

Update to gn files for Windows

This cl allows SwiftShader to be built on Windows within Chromium Change-Id: I0fc9ec1dfc5012cc310695e13edc64c639b23fda Reviewed-on: https://swiftshader-review.googlesource.com/5680Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 342b5c61
......@@ -13,7 +13,7 @@
# limitations under the License.
config("swiftshader_config") {
if (is_clang) {
if (is_clang) {
cflags = [
"-std=c++11",
]
......
......@@ -22,10 +22,15 @@ config("swiftshader_common_private_config") {
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
]
}
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
]
}
}
}
......
......@@ -19,14 +19,19 @@ config("swiftshader_main_private_config") {
"-DLOG_TAG=\"swiftshader_main\"",
"-msse2",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_main") {
......@@ -57,6 +62,14 @@ source_set("swiftshader_main") {
]
}
if (host_os == "win") {
configs -= [
"//build/config/win:unicode"
]
libs = [
"dxguid.lib" # For FrameBufferDD
]
}
configs += [
":swiftshader_main_private_config",
]
......
......@@ -18,14 +18,20 @@ config("swiftshader_opengl_common_private_config") {
cflags = [
"-DLOG_TAG=\"swiftshader_opengl_common\"",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_opengl_common") {
......
......@@ -19,14 +19,22 @@ config("swiftshader_opengl_compiler_private_config") {
"-DLOG_TAG=\"swiftshader_opengl_compiler\"",
"-Wno-sign-compare",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "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)
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_opengl_compiler") {
......
......@@ -18,14 +18,21 @@ config("swiftshader_opengl_preprocessor_private_config") {
cflags = [
"-DLOG_TAG=\"swiftshader_opengl_compiler\"",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "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)
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_opengl_preprocessor") {
......
......@@ -21,14 +21,22 @@ config("swiftshader_libEGL_private_config") {
"-DEGL_EGLEXT_PROTOTYPES",
"-Wno-sign-compare",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/DEGLAPI=",
"/DEGL_EGLEXT_PROTOTYPES",
"/wd4201", # nameless struct/union
"/wd4065", # switch statement contains 'default' but no 'case' labels
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
shared_library("swiftshader_libEGL") {
......@@ -55,6 +63,10 @@ shared_library("swiftshader_libEGL") {
sources += [
"OSXUtils.mm",
]
} else if (host_os == "win") {
configs -= [
"//build/config/win:unicode"
]
}
configs += [
......
......@@ -25,14 +25,24 @@ config("swiftshader_libGLESv2_private_config") {
"-DGL_GLEXT_PROTOTYPES",
"-Wno-sign-compare",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/DGL_API=",
"/DGL_APICALL=",
"/DGL_GLEXT_PROTOTYPES",
"/DLIBGLESV2_EXPORTS",
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
shared_library("swiftshader_libGLESv2") {
......@@ -69,6 +79,12 @@ shared_library("swiftshader_libGLESv2") {
"VertexDataManager.cpp",
]
if (host_os == "win") {
configs -= [
"//build/config/win:unicode"
]
}
configs += [
":swiftshader_libGLESv2_private_config",
]
......
......@@ -22,14 +22,20 @@ config("swiftshader_reactor_private_config") {
"-D__STDC_CONSTANT_MACROS",
"-D__STDC_LIMIT_MACROS",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_reactor") {
......@@ -48,6 +54,9 @@ source_set("swiftshader_reactor") {
sources += [
"DLL.cpp",
]
configs -= [
"//build/config/win:unicode"
]
}
configs += [
......
......@@ -21,14 +21,20 @@ config("swiftshader_renderer_private_config") {
"-msse2",
"-Wno-sign-compare",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_renderer") {
......@@ -58,6 +64,12 @@ source_set("swiftshader_renderer") {
"VertexProcessor.cpp",
]
if (host_os == "win") {
configs -= [
"//build/config/win:unicode"
]
}
configs += [
":swiftshader_renderer_private_config",
]
......
......@@ -19,14 +19,20 @@ config("swiftshader_shader_private_config") {
"-DLOG_TAG=\"swiftshader_shader\"",
"-fno-operator-names",
]
if (!is_debug) {
cflags += [
"-DNDEBUG",
"-DANGLE_DISABLE_TRACE",
} else {
if (host_os == "win") {
cflags = [
"/wd4201", # nameless struct/union
"/wd4324", # structure was padded due to alignment specifier
]
}
}
if (!is_debug) {
cflags += [
"-DANGLE_DISABLE_TRACE",
]
}
}
source_set("swiftshader_shader") {
......
......@@ -28,6 +28,26 @@ config("swiftshader_llvm_private_config") {
"-Wno-deprecated-declarations",
"-Wno-unused-variable",
]
} else {
if (host_os == "win") {
cflags = [
"/wd4005",
"/wd4065",
"/wd4146",
"/wd4245",
"/wd4267",
"/wd4310",
"/wd4319",
"/wd4334",
"/wd4389",
"/wd4624",
"/wd4701",
"/wd4702",
"/wd4703",
"/wd4706",
"/wd4800",
]
}
}
}
......@@ -407,13 +427,23 @@ source_set("swiftshader_llvm") {
"lib/VMCore/Verifier.cpp",
]
if (host_os == "win") {
configs -= [
"//build/config/win:unicode"
]
}
configs += [
":swiftshader_llvm_private_config",
]
include_dirs = [
"include-linux",
"include",
"lib/Target/X86",
]
if (host_os == "linux") {
include_dirs += [
"include-linux",
]
}
}
\ No newline at end of file
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