Commit d4bcfa2c by Corentin Wallez

Make the unittests compile in the GN build.

This changes angle_unittests.gypi to use a variable per list of files so that we can grab the list of files in conditions in BUILD.gn BUG=angleproject:929 Change-Id: I7fc73fd84d8efc1ea545fe672b1dba1c429b317f Reviewed-on: https://chromium-review.googlesource.com/296443Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 94d099d0
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014-2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# import the use_x11 variable # import the use_x11 variable
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//third_party/angle/build/angle_common.gni")
angle_git_is_present = exec_script("src/commit_id.py", angle_git_is_present = exec_script("src/commit_id.py",
[ [
...@@ -42,30 +43,11 @@ config("internal_config") { ...@@ -42,30 +43,11 @@ config("internal_config") {
] ]
} }
angle_enable_d3d9 = false
angle_enable_d3d11 = false
angle_enable_gl = false
if (is_win) { if (is_win) {
angle_enable_d3d9 = true
angle_enable_d3d11 = true
angle_enable_gl = true
import("//build/config/win/visual_studio_version.gni")
copy("copy_compiler_dll") { copy("copy_compiler_dll") {
sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ] sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
outputs = [ "$root_build_dir/d3dcompiler_47.dll" ] outputs = [ "$root_build_dir/d3dcompiler_47.dll" ]
} }
} # is_win
if (is_linux) {
angle_enable_gl = true
}
angle_enable_hlsl = false
if (angle_enable_d3d9 || angle_enable_d3d11) {
angle_enable_hlsl = true
} }
component("translator") { component("translator") {
......
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
angle_enable_d3d9 = false
angle_enable_d3d11 = false
angle_enable_gl = false
if (is_win) {
angle_enable_d3d9 = true
angle_enable_d3d11 = true
angle_enable_gl = true
import("//build/config/win/visual_studio_version.gni")
} # is_win
if (is_linux) {
angle_enable_gl = true
}
angle_enable_hlsl = false
if (angle_enable_d3d9 || angle_enable_d3d11) {
angle_enable_hlsl = true
}
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//testing/test.gni")
import("//third_party/angle/build/angle_common.gni")
unittests_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("angle_unittests.gypi"), "--replace=<(angle_path)=." ],
"scope",
[ "angle_unittests.gypi" ])
test("angle_unittests") {
include_dirs = [
"testing/gtest/include",
"../../src",
]
sources = rebase_path(unittests_gypi.angle_unittests_sources, ".", "../..")
if (angle_enable_hlsl) {
sources += rebase_path(unittests_gypi.angle_unittests_hlsl_sources, ".", "../..")
}
sources += [
"//gpu/angle_unittest_main.cc",
]
deps = [
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/angle:libANGLE",
"//third_party/angle:preprocessor",
"//third_party/angle:translator_static",
]
}
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
{ {
'variables': 'variables':
{ {
# This file list will be shared with the GN build.
'angle_unittests_sources': 'angle_unittests_sources':
[ [
'<(angle_path)/src/common/BitSetIterator_unittest.cpp', '<(angle_path)/src/common/BitSetIterator_unittest.cpp',
...@@ -76,7 +75,13 @@ ...@@ -76,7 +75,13 @@
'<(angle_path)/src/tests/test_utils/compiler_test.cpp', '<(angle_path)/src/tests/test_utils/compiler_test.cpp',
'<(angle_path)/src/tests/test_utils/compiler_test.h', '<(angle_path)/src/tests/test_utils/compiler_test.h',
], ],
'angle_unittests_hlsl_sources':
[
'<(angle_path)/src/tests/compiler_tests/UnrollFlatten_test.cpp',
],
}, },
# Everything below this but the WinRT configuration is duplicated in the GN build.
# If you change anything also change angle/BUILD.gn
'dependencies': 'dependencies':
[ [
'<(angle_path)/src/angle.gyp:libANGLE', '<(angle_path)/src/angle.gyp:libANGLE',
...@@ -122,7 +127,7 @@ ...@@ -122,7 +127,7 @@
# TODO(cwallez): make this angle_enable_hlsl instead (requires gyp file refactoring) # TODO(cwallez): make this angle_enable_hlsl instead (requires gyp file refactoring)
'sources': 'sources':
[ [
'<(angle_path)/src/tests/compiler_tests/UnrollFlatten_test.cpp', '<@(angle_unittests_hlsl_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