Put feature utility into it's own library

To minimize system impact, have feature configuration utility
live in it's own library.

Bug=angleproject:2418

Change-Id: Ic8e3862965e515ded7e1a6078a7b9f8b92878818
Reviewed-on: https://chromium-review.googlesource.com/c/1269822
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
This commit is contained in:
Courtney Goeltzenleuchter 2018-10-08 19:25:19 -06:00 коммит произвёл Commit Bot
Родитель 563fbaa046
Коммит 7d81ae7177
2 изменённых файлов: 53 добавлений и 60 удалений

109
BUILD.gn
Просмотреть файл

@ -223,42 +223,20 @@ static_library("angle_image_util") {
]
}
config("angle_feature_support_util_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
config("angle_gl_visibility_config") {
if (is_win) {
defines = [
"GL_APICALL=",
"GL_API=",
]
} else {
defines = [
"GL_APICALL=__attribute__((visibility(\"default\")))",
"GL_API=__attribute__((visibility(\"default\")))",
]
}
}
static_library("angle_feature_support_util") {
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [
":angle_feature_support_util_config",
"third_party/jsoncpp:jsoncpp_config",
]
public_deps = [
":angle_common",
]
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
deps = [
"third_party/jsoncpp:jsoncpp",
]
}
config("angle_gpu_info_util_config") {
include_dirs = [
"include",
@ -508,9 +486,6 @@ static_library("libANGLE") {
":includes",
":translator",
]
if (is_android) {
deps += [ ":angle_feature_support_util" ]
}
# Shared D3D sources.
if (angle_enable_d3d9 || angle_enable_d3d11) {
@ -668,6 +643,7 @@ shared_library("libGLESv2${angle_libs_suffix}") {
configs -= angle_undefine_configs
configs += [
":angle_gl_visibility_config",
":commit_id_config",
":debug_annotations_config",
":extra_warnings",
@ -675,17 +651,6 @@ shared_library("libGLESv2${angle_libs_suffix}") {
]
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
if (is_win) {
defines += [
"GL_APICALL=",
"GL_API=",
]
} else {
defines += [
"GL_APICALL=__attribute__((visibility(\"default\")))",
"GL_API=__attribute__((visibility(\"default\")))",
]
}
deps = [
":includes",
@ -730,6 +695,7 @@ shared_library("libGLESv1_CM${angle_libs_suffix}") {
configs -= angle_undefine_configs
configs += [
":angle_gl_visibility_config",
":commit_id_config",
":debug_annotations_config",
":extra_warnings",
@ -737,17 +703,6 @@ shared_library("libGLESv1_CM${angle_libs_suffix}") {
]
defines = []
if (is_win) {
defines += [
"GL_APICALL=",
"GL_API=",
]
} else {
defines += [
"GL_APICALL=__attribute__((visibility(\"default\")))",
"GL_API=__attribute__((visibility(\"default\")))",
]
}
deps = [
":includes",
@ -950,6 +905,42 @@ executable("angle_shader_translator") {
}
if (is_android) {
config("angle_feature_support_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
}
}
shared_library("libfeature_support${angle_libs_suffix}") {
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ ":build_id_config" ]
configs -= angle_undefine_configs
configs += [
":internal_config",
":extra_warnings",
]
public_configs = [
":angle_feature_support_config",
"third_party/jsoncpp:jsoncpp_config",
]
libs = [ "log" ]
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
deps = [
"third_party/jsoncpp:jsoncpp",
]
}
# Package ANGLE libraries for pre-installed system image
android_assets("angle_apk_assets") {
disable_compression = true
@ -966,6 +957,7 @@ if (is_android) {
"//third_party/angle:libEGL${angle_libs_suffix}($android_secondary_abi_toolchain)",
"//third_party/angle:libGLESv1_CM${angle_libs_suffix}($android_secondary_abi_toolchain)",
"//third_party/angle:libGLESv2${angle_libs_suffix}($android_secondary_abi_toolchain)",
"//third_party/angle:libfeature_support${angle_libs_suffix}($android_secondary_abi_toolchain)",
]
}
@ -977,6 +969,7 @@ if (is_android) {
"//third_party/angle:libEGL${angle_libs_suffix}",
"//third_party/angle:libGLESv1_CM${angle_libs_suffix}",
"//third_party/angle:libGLESv2${angle_libs_suffix}",
"//third_party/angle:libfeature_support${angle_libs_suffix}",
]
}
}

Просмотреть файл

@ -12,14 +12,14 @@
#if !defined(ANGLE_EXPORT)
#if defined(_WIN32)
#if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBANGLE_UTIL_IMPLEMENTATION)
defined(LIBANGLE_UTIL_IMPLEMENTATION) || defined(LIBFEATURE_SUPPORT_IMPLEMENTATION)
# define ANGLE_EXPORT __declspec(dllexport)
# else
# define ANGLE_EXPORT __declspec(dllimport)
# endif
#elif defined(__GNUC__)
#if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBANGLE_UTIL_IMPLEMENTATION)
defined(LIBANGLE_UTIL_IMPLEMENTATION) || defined(LIBFEATURE_SUPPORT_IMPLEMENTATION)
# define ANGLE_EXPORT __attribute__((visibility ("default")))
# else
# define ANGLE_EXPORT