Commit 1ba72546 by Jamie Madill Committed by Commit Bot

GN: Allow building without /build/ folder.

This will allow for ANGLE to be used in the Skia build. Bug: angleproject:3943 Change-Id: Idd1840f4445c63e696a7cdcd8b873623b8408306 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1835346 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
parent f7ad03aa
......@@ -3,15 +3,18 @@
# found in the LICENSE file.
# import the use_x11 variable
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("gni/angle.gni")
if (is_android) {
# android/rules.gni can only be imported for Android targets
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("android/angle_apk.gni")
if (angle_has_build) {
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
if (is_android) {
# android/rules.gni can only be imported for Android targets
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("android/angle_apk.gni")
}
}
declare_args() {
......@@ -28,7 +31,7 @@ declare_args() {
# Don't build extra (test, samples etc) for Windows UWP. We don't have
# infrastructure (e.g. windowing helper functions) in place to run them.
angle_build_all = !angle_is_winuwp
angle_build_all = !angle_is_winuwp && angle_has_build
}
if (!build_with_chromium && angle_build_all) {
......@@ -159,9 +162,11 @@ config("better_linux_stack_traces") {
}
}
_use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64"
# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (is_win && target_cpu != "arm64") {
if (_use_copy_compiler_dll) {
# We also ship an older DLL for compatiblity with Windows 7 machines without
# the UCRT. This DLL isn't available in the standard SDK distribution.
_old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll"
......@@ -253,13 +258,15 @@ angle_source_set("xxhash") {
configs -= [ "${angle_root}:extra_warnings" ]
}
fuzzer_test("xxhash_fuzzer") {
sources = [
"src/common/third_party/xxhash/xxhash_fuzzer.cpp",
]
deps = [
":xxhash",
]
if (angle_has_build) {
fuzzer_test("xxhash_fuzzer") {
sources = [
"src/common/third_party/xxhash/xxhash_fuzzer.cpp",
]
deps = [
":xxhash",
]
}
}
angle_static_library("angle_common") {
......@@ -281,7 +288,7 @@ angle_static_library("angle_common") {
]
public_configs += [ ":angle_common_config" ]
all_dependent_configs = [ ":angle_release_asserts_config" ]
if (use_fuzzing_engine) {
if (angle_has_build && use_fuzzing_engine) {
all_dependent_configs += [ ":angle_disable_pool_alloc" ]
}
}
......@@ -683,7 +690,7 @@ angle_source_set("libANGLE_base") {
# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (is_win && target_cpu != "arm64") {
if (_use_copy_compiler_dll) {
data_deps = [
":copy_compiler_dll",
]
......@@ -1121,45 +1128,47 @@ angle_executable("angle_shader_translator") {
]
}
config("angle_feature_support_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
if (angle_has_build) {
config("angle_feature_support_config") {
include_dirs = [
"include",
"src",
]
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
}
}
}
angle_shared_library("libfeature_support") {
output_name = "libfeature_support${angle_libs_suffix}"
if (is_android) {
libs = [ "log" ]
}
angle_shared_library("libfeature_support") {
output_name = "libfeature_support${angle_libs_suffix}"
public_configs += [
":angle_feature_support_config",
"${angle_jsoncpp_dir}:jsoncpp_config",
]
if (is_android) {
libs = [ "log" ]
}
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
public_configs += [
":angle_feature_support_config",
"${angle_jsoncpp_dir}:jsoncpp_config",
]
}
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
}
deps = [
":angle_gpu_info_util",
"${angle_jsoncpp_dir}:jsoncpp",
]
sources = [
"src/feature_support_util/feature_support_util.cpp",
"src/feature_support_util/feature_support_util.h",
]
deps = [
":angle_gpu_info_util",
"${angle_jsoncpp_dir}:jsoncpp",
]
}
}
if (!is_component_build && is_android && symbol_level != 0) {
......@@ -1226,3 +1235,11 @@ if (!is_component_build && is_android &&
]
}
}
# Note: libGLESv1_CM is not presently included because most Chrome users don't care about it.
group("angle") {
data_deps = [
":libGLESv2",
":libEGL",
]
}
......@@ -5,6 +5,9 @@
# Override for angle_root
angle_root = "//"
# True if ANGLE can access build/, testing/ and other Chrome folders.
angle_has_build = true
# Overrides for ANGLE's dependencies
angle_glslang_dir = "//third_party/glslang/src"
angle_googletest_dir = "//third_party/googletest/src"
......
......@@ -2,15 +2,32 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/dcheck_always_on.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni") # import the use_x11 variable
import("//build_overrides/angle.gni")
import("//build_overrides/build.gni")
import("//build_overrides/swiftshader.gni")
import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
if (angle_has_build) {
import("//build/config/dcheck_always_on.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni") # import the use_x11 variable
import("//build_overrides/build.gni")
import("//testing/test.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
}
} else {
declare_args() {
is_ubsan = false
is_tsan = false
is_asan = false
build_with_chromium = false
dcheck_always_on = false
use_x11 = is_linux
use_ozone = false
use_fuzzing_engine = false
}
}
if (build_with_chromium) {
......@@ -70,8 +87,9 @@ declare_args() {
# Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714.
# Otherwise, API level 24 would have been enough.
angle_enable_vulkan =
(is_win && !angle_is_winuwp) || (is_linux && use_x11 && !is_chromeos) ||
(is_android && ndk_api_level_at_least_26) || is_fuchsia
angle_has_build &&
((is_win && !angle_is_winuwp) || (is_linux && use_x11 && !is_chromeos) ||
(is_android && ndk_api_level_at_least_26) || is_fuchsia)
angle_enable_null = true
angle_enable_essl = true
angle_enable_glsl = true
......@@ -91,21 +109,21 @@ declare_args() {
angle_enable_overlay = false
}
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
}
angle_common_configs = [
angle_root + ":better_linux_stack_traces",
angle_root + ":extra_warnings",
angle_root + ":internal_config",
]
angle_remove_configs = [ "//build/config/compiler:default_include_dirs" ]
angle_remove_configs = []
if (angle_has_build) {
angle_remove_configs += [ "//build/config/compiler:default_include_dirs" ]
}
angle_better_stack_traces =
(is_debug || dcheck_always_on) && is_linux && !is_asan && !is_cfi
if (is_clang) {
if (angle_has_build && is_clang) {
angle_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
# Disabled to enable better stack traces.
......
......@@ -4,6 +4,7 @@
#
# This file houses the build configuration for the ANGLE Vulkan back-end.
import("//build_overrides/swiftshader.gni")
import("../../../../gni/angle.gni")
assert(angle_enable_vulkan)
......
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