Commit 683dd1d6 by Jamie Madill Committed by Commit Bot

GN: Move util build code into util/BUILD.gn.

Prepratory clean up for WinUWP support. Bug: angleproject:4182 Change-Id: I97cc6cb42a50c6b57ca7d375d1e0a6b3da7aa9d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1998673 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 54d0d539
...@@ -1023,164 +1023,6 @@ angle_static_library("libEGL_static") { ...@@ -1023,164 +1023,6 @@ angle_static_library("libEGL_static") {
] ]
} }
import("util/util.gni")
config("angle_util_loader_config") {
defines = [ "ANGLE_USE_UTIL_LOADER" ]
}
angle_source_set("angle_util_loader_headers") {
testonly = true
sources = [
"util/egl_loader_autogen.h",
"util/gles_loader_autogen.h",
"util/util_export.h",
]
if (is_win && !angle_is_winuwp) {
sources += [ "util/windows/wgl_loader_autogen.h" ]
}
public_deps = [
":includes",
]
}
angle_source_set("angle_util_loader") {
testonly = true
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
sources = [
"util/egl_loader_autogen.cpp",
"util/gles_loader_autogen.cpp",
]
if (is_win && !angle_is_winuwp) {
sources += [ "util/windows/wgl_loader_autogen.cpp" ]
}
deps = [
":angle_util_loader_headers",
]
public_configs += [
":angle_util_config",
":angle_util_loader_config",
":no_gl_prototypes",
]
}
config("angle_util_config") {
include_dirs = [ "." ]
if (is_linux && angle_use_x11) {
libs = [ "X11" ]
}
}
foreach(is_shared_library,
[
true,
false,
]) {
if (is_shared_library) {
library_type = "angle_shared_library"
library_name = "angle_util"
dep_suffix = "${angle_libs_suffix}"
} else {
library_type = "angle_static_library"
library_name = "angle_util_static"
dep_suffix = "_static"
}
target(library_type, library_name) {
testonly = true
sources = util_sources
deps = [
":angle_common",
":angle_util_loader_headers",
"util:angle_test_utils",
]
public_deps = []
libs = []
if (is_win && !angle_is_winuwp) {
sources += util_win_sources
}
if (is_linux) {
libs += [
"rt",
"dl",
]
}
if (is_mac) {
sources += util_osx_sources
libs += [
"AppKit.framework",
"QuartzCore.framework",
]
}
if (angle_use_x11) {
sources += util_x11_sources
}
if (is_android) {
# To prevent linux sources filtering on android
set_sources_assignment_filter([])
sources += util_android_sources
libs += [
"android",
"log",
]
}
configs += [ ":debug_annotations_config" ]
public_configs += [ ":angle_util_config" ]
if (is_fuchsia) {
sources += util_fuchsia_sources
public_deps += [
"src/common/fuchsia_egl",
"//third_party/fuchsia-sdk/sdk:async-loop-cpp",
"//third_party/fuchsia-sdk/sdk:async-loop-default",
"//third_party/fuchsia-sdk/sdk:fdio",
"//third_party/fuchsia-sdk/sdk:fuchsia-images",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-policy",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-scenic",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-views",
"//third_party/fuchsia-sdk/sdk:scenic_cpp",
]
} else if (use_ozone) {
sources += util_ozone_sources
}
if (is_shared_library) {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
if (is_win && !angle_is_winuwp) {
sources += util_win_shared_sources
}
public_deps += [ ":angle_util_loader" ]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/libangle_util.dylib",
]
}
} else {
public_configs += [
":angle_static",
":gl_prototypes",
]
}
}
}
# Convenience targets for some of the samples so they can be built # Convenience targets for some of the samples so they can be built
# with Chromium's toolchain. # with Chromium's toolchain.
angle_executable("angle_shader_translator") { angle_executable("angle_shader_translator") {
......
...@@ -33,9 +33,9 @@ angle_source_set("sample_util") { ...@@ -33,9 +33,9 @@ angle_source_set("sample_util") {
] ]
public_deps = [ public_deps = [
"../:angle_common", "../:angle_common",
"../:angle_util",
"../:angle_util_loader_headers",
"../util:angle_test_utils", "../util:angle_test_utils",
"../util:angle_util",
"../util:angle_util_loader_headers",
] ]
configs += [ "../:library_name_config" ] configs += [ "../:library_name_config" ]
public_configs = [ public_configs = [
......
...@@ -69,13 +69,13 @@ angle_test("angle_unittests") { ...@@ -69,13 +69,13 @@ angle_test("angle_unittests") {
deps = [ deps = [
":angle_test_expectations", ":angle_test_expectations",
"$angle_root:angle_util_static",
"$angle_root:libANGLE", "$angle_root:libANGLE",
"$angle_root:libEGL_static", "$angle_root:libEGL_static",
"$angle_root:libGLESv2_static", "$angle_root:libGLESv2_static",
"$angle_root:libfeature_support", "$angle_root:libfeature_support",
"$angle_root:preprocessor", "$angle_root:preprocessor",
"$angle_root:translator", "$angle_root:translator",
"$angle_root/util:angle_util_static",
] ]
if (!is_android && !is_fuchsia) { if (!is_android && !is_fuchsia) {
# SystemUtils.RunApp, the only unittest using a helper binary, is not supported on these # SystemUtils.RunApp, the only unittest using a helper binary, is not supported on these
...@@ -117,16 +117,16 @@ if (is_win || is_linux || is_mac || is_android || is_fuchsia) { ...@@ -117,16 +117,16 @@ if (is_win || is_linux || is_mac || is_android || is_fuchsia) {
deps = [ deps = [
":angle_test_expectations", ":angle_test_expectations",
"${angle_root}:angle_gpu_info_util", "$angle_root:angle_gpu_info_util",
"${angle_root}:angle_image_util", "$angle_root:angle_image_util",
"${angle_root}:angle_util", "$angle_root/util:angle_util",
"${angle_root}:angle_util_loader_headers", "$angle_root/util:angle_util_loader_headers",
] ]
data_deps = [ data_deps = [
"${angle_root}:libEGL", "$angle_root:libEGL",
"${angle_root}:libGLESv1_CM", "$angle_root:libGLESv1_CM",
"${angle_root}:libGLESv2", "$angle_root:libGLESv2",
] ]
if (angle_enable_vulkan) { if (angle_enable_vulkan) {
...@@ -164,12 +164,12 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -164,12 +164,12 @@ if (is_win || is_linux || is_mac || is_android) {
] ]
deps = [ deps = [
"${angle_root}:angle_util_static", "$angle_root:libANGLE",
"${angle_root}:libANGLE", "$angle_root:libEGL_static",
"${angle_root}:libEGL_static", "$angle_root:libGLESv2_static",
"${angle_root}:libGLESv2_static", "$angle_root:preprocessor",
"${angle_root}:preprocessor", "$angle_root:translator",
"${angle_root}:translator", "$angle_root/util:angle_util_static",
] ]
deps += [ "${angle_root}:angle_gl_enum_utils" ] deps += [ "${angle_root}:angle_gl_enum_utils" ]
...@@ -193,11 +193,11 @@ if (is_win || is_linux || is_android || is_mac) { ...@@ -193,11 +193,11 @@ if (is_win || is_linux || is_android || is_mac) {
main = "angle_perftests_main" main = "angle_perftests_main"
deps = [ deps = [
"${angle_jsoncpp_dir}:jsoncpp", "$angle_jsoncpp_dir:jsoncpp",
"${angle_root}:angle_util_static", "$angle_root:libANGLE",
"${angle_root}:libANGLE", "$angle_root:libEGL_static",
"${angle_root}:libEGL_static", "$angle_root:libGLESv2_static",
"${angle_root}:libGLESv2_static", "$angle_root/util:angle_util_static",
] ]
if (is_win) { if (is_win) {
...@@ -232,13 +232,13 @@ if (is_win || is_linux || is_android || is_mac || is_fuchsia) { ...@@ -232,13 +232,13 @@ if (is_win || is_linux || is_android || is_mac || is_fuchsia) {
main = "angle_perftests_main" main = "angle_perftests_main"
deps = [ deps = [
"${angle_jsoncpp_dir}:jsoncpp", "$angle_jsoncpp_dir:jsoncpp",
"${angle_root}:angle_common", "$angle_root:angle_common",
"${angle_root}:angle_gpu_info_util", "$angle_root:angle_gpu_info_util",
"${angle_root}:angle_system_utils", "$angle_root:angle_system_utils",
"${angle_root}:angle_util", "$angle_root/util:angle_util",
"${angle_root}:angle_util_loader_headers", "$angle_root/util:angle_util_loader_headers",
"${angle_spirv_tools_dir}:spvtools_val", "$angle_spirv_tools_dir:spvtools_val",
] ]
data_deps = [ data_deps = [
...@@ -321,8 +321,8 @@ if (build_angle_gles1_conform_tests) { ...@@ -321,8 +321,8 @@ if (build_angle_gles1_conform_tests) {
] ]
public_configs = [ public_configs = [
"$angle_root/util:angle_util_config",
"$angle_root:angle_static", "$angle_root:angle_static",
"$angle_root:angle_util_config",
"$angle_root:gl_prototypes", "$angle_root:gl_prototypes",
] ]
...@@ -330,12 +330,12 @@ if (build_angle_gles1_conform_tests) { ...@@ -330,12 +330,12 @@ if (build_angle_gles1_conform_tests) {
public_deps = [ public_deps = [
"$angle_root:angle_common", "$angle_root:angle_common",
"$angle_root:angle_util_static",
"$angle_root:libEGL_static", "$angle_root:libEGL_static",
"$angle_root:libGLESv1_CM_static", "$angle_root:libGLESv1_CM_static",
"$angle_root:libGLESv2_static", "$angle_root:libGLESv2_static",
"$angle_root:preprocessor", "$angle_root:preprocessor",
"$angle_root:translator", "$angle_root:translator",
"$angle_root/util:angle_util_static",
] ]
sources = [ sources = [
...@@ -774,8 +774,8 @@ if (build_angle_deqp_tests && !is_fuchsia) { ...@@ -774,8 +774,8 @@ if (build_angle_deqp_tests && !is_fuchsia) {
":angle_deqp_framework_common", ":angle_deqp_framework_common",
":angle_deqp_framework_egl", ":angle_deqp_framework_egl",
":angle_deqp_glshared", ":angle_deqp_glshared",
"${angle_root}:angle_common", "$angle_root:angle_common",
"${angle_root}:angle_util", "$angle_root/util:angle_util",
] ]
data_deps = [ data_deps = [
...@@ -824,8 +824,8 @@ if (build_angle_deqp_tests && !is_fuchsia) { ...@@ -824,8 +824,8 @@ if (build_angle_deqp_tests && !is_fuchsia) {
deps += [ deps += [
":angle_deqp_libtester", ":angle_deqp_libtester",
"$angle_root:angle_util",
"$angle_root/util:angle_test_utils", "$angle_root/util:angle_test_utils",
"$angle_root/util:angle_util",
] ]
suppressed_configs += deqp_undefine_configs suppressed_configs += deqp_undefine_configs
...@@ -855,8 +855,8 @@ if (build_angle_deqp_tests && !is_fuchsia) { ...@@ -855,8 +855,8 @@ if (build_angle_deqp_tests && !is_fuchsia) {
deps = [ deps = [
":${shared_library_name}", ":${shared_library_name}",
":angle_test_expectations", ":angle_test_expectations",
"${angle_root}:angle_common", "$angle_root:angle_common",
"${angle_root}:angle_util", "$angle_root/util:angle_util",
] ]
# Must be included outside of the source set for the define # Must be included outside of the source set for the define
......
...@@ -4,6 +4,234 @@ ...@@ -4,6 +4,234 @@
import("../gni/angle.gni") import("../gni/angle.gni")
_util_sources = [
"com_utils.h",
"keyboard.h",
"geometry_utils.cpp",
"geometry_utils.h",
"mouse.h",
"random_utils.cpp",
"random_utils.h",
"shader_utils.cpp",
"shader_utils.h",
"util_export.h",
"util_gl.h",
"Event.h",
"EGLPlatformParameters.h",
"EGLWindow.cpp",
"EGLWindow.h",
"Matrix.cpp",
"Matrix.h",
"OSPixmap.h",
"OSWindow.cpp",
"OSWindow.h",
]
if (is_win) {
_util_sources += [ "windows/WGLWindow.h" ]
if (!angle_is_winuwp) {
_util_sources += [
"windows/win32/Win32Pixmap.cpp",
"windows/win32/Win32Pixmap.h",
"windows/win32/Win32Window.cpp",
"windows/win32/Win32Window.h",
]
}
}
if (angle_use_x11) {
_util_sources += [
"x11/X11Pixmap.cpp",
"x11/X11Pixmap.h",
"x11/X11Window.cpp",
"x11/X11Window.h",
]
}
if (is_fuchsia) {
_util_sources += [
"fuchsia/ScenicWindow.cpp",
"fuchsia/ScenicWindow.h",
]
} else if (use_ozone) {
_util_sources += [
"ozone/OzonePixmap.cpp",
"ozone/OzoneWindow.cpp",
"ozone/OzoneWindow.h",
]
}
if (is_mac) {
_util_sources += [
"osx/OSXPixmap.mm",
"osx/OSXPixmap.h",
"osx/OSXWindow.mm",
"osx/OSXWindow.h",
]
}
if (is_android) {
_util_sources += [
"android/AndroidPixmap.cpp",
"android/AndroidWindow.cpp",
"android/AndroidWindow.h",
"android/third_party/android_native_app_glue.c",
"android/third_party/android_native_app_glue.h",
]
}
config("angle_util_loader_config") {
defines = [ "ANGLE_USE_UTIL_LOADER" ]
}
config("angle_util_loader_headers_config") {
include_dirs = [ ".." ]
}
angle_source_set("angle_util_loader_headers") {
testonly = true
sources = [
"egl_loader_autogen.h",
"gles_loader_autogen.h",
"util_export.h",
]
if (is_win && !angle_is_winuwp) {
sources += [ "windows/wgl_loader_autogen.h" ]
}
public_deps = [
"$angle_root:includes",
]
public_configs = [ ":angle_util_loader_headers_config" ]
}
angle_source_set("angle_util_loader") {
testonly = true
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
sources = [
"egl_loader_autogen.cpp",
"gles_loader_autogen.cpp",
]
if (is_win && !angle_is_winuwp) {
sources += [ "windows/wgl_loader_autogen.cpp" ]
}
deps = [
":angle_util_loader_headers",
]
public_configs += [
"$angle_root:no_gl_prototypes",
":angle_util_config",
":angle_util_loader_config",
":angle_util_loader_headers_config",
]
}
config("angle_util_config") {
include_dirs = [ "." ]
if (is_linux && angle_use_x11) {
libs = [ "X11" ]
}
}
foreach(is_shared_library,
[
true,
false,
]) {
if (is_shared_library) {
library_type = "angle_shared_library"
library_name = "angle_util"
dep_suffix = "${angle_libs_suffix}"
} else {
library_type = "angle_static_library"
library_name = "angle_util_static"
dep_suffix = "_static"
}
target(library_type, library_name) {
testonly = true
sources = _util_sources
deps = [
":angle_test_utils",
":angle_util_loader_headers",
"$angle_root:angle_common",
]
public_deps = []
libs = []
if (is_linux) {
libs += [
"rt",
"dl",
]
}
if (is_mac) {
libs += [
"AppKit.framework",
"QuartzCore.framework",
]
}
if (is_android) {
# To prevent linux sources filtering on android
set_sources_assignment_filter([])
libs += [
"android",
"log",
]
}
configs += [ "$angle_root:debug_annotations_config" ]
public_configs += [ ":angle_util_config" ]
if (is_fuchsia) {
public_deps += [
"$angle_root/src/common/fuchsia_egl",
"//third_party/fuchsia-sdk/sdk:async-loop-cpp",
"//third_party/fuchsia-sdk/sdk:async-loop-default",
"//third_party/fuchsia-sdk/sdk:fdio",
"//third_party/fuchsia-sdk/sdk:fuchsia-images",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-policy",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-scenic",
"//third_party/fuchsia-sdk/sdk:fuchsia-ui-views",
"//third_party/fuchsia-sdk/sdk:scenic_cpp",
]
}
if (is_shared_library) {
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
public_deps += [ ":angle_util_loader" ]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/libangle_util.dylib",
]
}
# Currently excluded from the static build because of build issues.
# Would be nice if could be included.
if (is_win && !angle_is_winuwp) {
sources += [ "windows/WGLWindow.cpp" ]
}
} else {
public_configs += [
"$angle_root:angle_static",
"$angle_root:gl_prototypes",
]
}
}
}
if (is_win && !angle_is_winuwp) { if (is_win && !angle_is_winuwp) {
angle_source_set("angle_stack_walker") { angle_source_set("angle_stack_walker") {
sources = [ sources = [
......
# Copyright 2014 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
util_sources = [
"util/com_utils.h",
"util/keyboard.h",
"util/geometry_utils.cpp",
"util/geometry_utils.h",
"util/mouse.h",
"util/random_utils.cpp",
"util/random_utils.h",
"util/shader_utils.cpp",
"util/shader_utils.h",
"util/util_export.h",
"util/util_gl.h",
"util/Event.h",
"util/EGLPlatformParameters.h",
"util/EGLWindow.cpp",
"util/EGLWindow.h",
"util/Matrix.cpp",
"util/Matrix.h",
"util/OSPixmap.h",
"util/OSWindow.cpp",
"util/OSWindow.h",
]
util_win_sources = [
"util/windows/win32/Win32Pixmap.cpp",
"util/windows/win32/Win32Pixmap.h",
"util/windows/win32/Win32Window.cpp",
"util/windows/win32/Win32Window.h",
"util/windows/WGLWindow.h",
]
if (current_os != "winuwp") {
util_win_shared_sources = [ "util/windows/WGLWindow.cpp" ]
}
util_x11_sources = [
"util/x11/X11Pixmap.cpp",
"util/x11/X11Pixmap.h",
"util/x11/X11Window.cpp",
"util/x11/X11Window.h",
]
util_fuchsia_sources = [
"util/fuchsia/ScenicWindow.cpp",
"util/fuchsia/ScenicWindow.h",
]
util_ozone_sources = [
"util/ozone/OzonePixmap.cpp",
"util/ozone/OzoneWindow.cpp",
"util/ozone/OzoneWindow.h",
]
util_osx_sources = [
"util/osx/OSXPixmap.mm",
"util/osx/OSXPixmap.h",
"util/osx/OSXWindow.mm",
"util/osx/OSXWindow.h",
]
util_android_sources = [
"util/android/AndroidPixmap.cpp",
"util/android/AndroidWindow.cpp",
"util/android/AndroidWindow.h",
"util/android/third_party/android_native_app_glue.c",
"util/android/third_party/android_native_app_glue.h",
]
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