Commit beb81589 by Corentin Wallez

Make the end2end tests compile in the GN build.

BUG=angleproject:929 Change-Id: Ifc5ad03579c3e187721842f7585f3f06b69cbf45 Reviewed-on: https://chromium-review.googlesource.com/296682Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 48705cad
...@@ -105,6 +105,7 @@ config("translator_static_config") { ...@@ -105,6 +105,7 @@ config("translator_static_config") {
defines = [ "ANGLE_TRANSLATOR_STATIC" ] defines = [ "ANGLE_TRANSLATOR_STATIC" ]
} }
config("debug_annotations_config") { config("debug_annotations_config") {
if (is_debug) { if (is_debug) {
defines = [ defines = [
...@@ -219,10 +220,20 @@ config("libANGLE_config") { ...@@ -219,10 +220,20 @@ config("libANGLE_config") {
defines += [ "ANGLE_USE_X11" ] defines += [ "ANGLE_USE_X11" ]
} }
defines += [ defines += [
"GL_APICALL=",
"GL_GLEXT_PROTOTYPES=", "GL_GLEXT_PROTOTYPES=",
"EGLAPI=",
] ]
if (is_win) {
defines += [
"GL_APICALL=",
"EGLAPI=",
]
} else {
defines += [
"GL_APICALL=__attribute__((visibility(\"default\")))",
"EGLAPI=__attribute__((visibility(\"default\")))",
]
}
if (is_win) { if (is_win) {
cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled. cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled.
} }
...@@ -337,6 +348,7 @@ shared_library("libEGL") { ...@@ -337,6 +348,7 @@ shared_library("libEGL") {
configs += [ configs += [
":internal_config", ":internal_config",
":commit_id_config", ":commit_id_config",
":debug_annotations_config",
":libANGLE_config", ":libANGLE_config",
"//build/config/compiler:no_chromium_code", "//build/config/compiler:no_chromium_code",
] ]
...@@ -350,3 +362,43 @@ shared_library("libEGL") { ...@@ -350,3 +362,43 @@ shared_library("libEGL") {
":libGLESv2", ":libGLESv2",
] ]
} }
util_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("util/util.gyp") ],
"scope",
[ "util/util.gyp" ])
static_library("angle_util") {
sources = rebase_path(util_gypi.util_sources, ".", "util")
if (is_win) {
sources += rebase_path(util_gypi.util_win32_sources, ".", "util")
}
if (is_linux) {
sources += rebase_path(util_gypi.util_linux_sources, ".", "util")
}
if (is_mac) {
sources += rebase_path(util_gypi.util_osx_sources, ".", "util")
}
if (use_x11) {
sources += rebase_path(util_gypi.util_x11_sources, ".", "util")
}
configs += [
":internal_config",
":debug_annotations_config",
]
include_dirs = [
"util",
]
deps = [
":libEGL",
":libGLESv2",
]
}
...@@ -37,3 +37,45 @@ test("angle_unittests") { ...@@ -37,3 +37,45 @@ test("angle_unittests") {
"//third_party/angle:translator_static", "//third_party/angle:translator_static",
] ]
} }
end2end_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("angle_end2end_tests.gypi"), "--replace=<(angle_path)=." ],
"scope",
[ "angle_unittests.gypi" ])
test("angle_end2end_tests") {
include_dirs = [
"testing/gtest/include",
"../../src/tests",
"../../util",
]
sources = rebase_path(end2end_gypi.angle_end2end_tests_sources, ".", "../..")
if (is_win) {
sources += rebase_path(end2end_gypi.angle_end2end_tests_win_sources, ".", "../..")
}
sources += [
"//gpu/angle_end2end_tests_main.cc",
]
configs += [
"//third_party/angle:internal_config",
"//third_party/angle:libANGLE_config",
]
deps = [
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/angle:angle_util",
"//third_party/angle:libANGLE",
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
"//third_party/angle:preprocessor",
"//third_party/angle:translator_static",
]
}
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
# gtest harness in a main.cpp. # gtest harness in a main.cpp.
{ {
# Everything below this is duplicated in the GN build.
# If you change anything also change angle/src/tests/BUILD.gn
'variables': 'variables':
{ {
# This file list will be shared with the GN build.
'angle_end2end_tests_sources': 'angle_end2end_tests_sources':
[ [
'<(angle_path)/src/tests/gl_tests/BlendMinMaxTest.cpp', '<(angle_path)/src/tests/gl_tests/BlendMinMaxTest.cpp',
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
], ],
}, },
# Everything below this but the WinRT configuration is duplicated in the GN build. # Everything below this but the WinRT configuration is duplicated in the GN build.
# If you change anything also change angle/BUILD.gn # If you change anything also change angle/src/tests/BUILD.gn
'dependencies': 'dependencies':
[ [
'<(angle_path)/src/angle.gyp:libANGLE', '<(angle_path)/src/angle.gyp:libANGLE',
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# found in the LICENSE file. # found in the LICENSE file.
{ {
# Everything below this is duplicated in the GN build, except Mac support.
# If you change anything also change angle/BUILD.gn
'variables': 'variables':
{ {
'util_sources': 'util_sources':
......
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