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 @@ ...@@ -3,15 +3,18 @@
# found in the LICENSE file. # found in the LICENSE file.
# import the use_x11 variable # 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") import("gni/angle.gni")
if (is_android) { if (angle_has_build) {
# android/rules.gni can only be imported for Android targets import("//build/config/linux/pkg_config.gni")
import("//build/config/android/config.gni") import("//build/config/ui.gni")
import("//build/config/android/rules.gni") import("//testing/libfuzzer/fuzzer_test.gni")
import("android/angle_apk.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() { declare_args() {
...@@ -28,7 +31,7 @@ declare_args() { ...@@ -28,7 +31,7 @@ declare_args() {
# Don't build extra (test, samples etc) for Windows UWP. We don't have # 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. # 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) { if (!build_with_chromium && angle_build_all) {
...@@ -159,9 +162,11 @@ config("better_linux_stack_traces") { ...@@ -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 # Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox. # 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 # 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. # the UCRT. This DLL isn't available in the standard SDK distribution.
_old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll" _old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll"
...@@ -253,13 +258,15 @@ angle_source_set("xxhash") { ...@@ -253,13 +258,15 @@ angle_source_set("xxhash") {
configs -= [ "${angle_root}:extra_warnings" ] configs -= [ "${angle_root}:extra_warnings" ]
} }
fuzzer_test("xxhash_fuzzer") { if (angle_has_build) {
sources = [ fuzzer_test("xxhash_fuzzer") {
"src/common/third_party/xxhash/xxhash_fuzzer.cpp", sources = [
] "src/common/third_party/xxhash/xxhash_fuzzer.cpp",
deps = [ ]
":xxhash", deps = [
] ":xxhash",
]
}
} }
angle_static_library("angle_common") { angle_static_library("angle_common") {
...@@ -281,7 +288,7 @@ angle_static_library("angle_common") { ...@@ -281,7 +288,7 @@ angle_static_library("angle_common") {
] ]
public_configs += [ ":angle_common_config" ] public_configs += [ ":angle_common_config" ]
all_dependent_configs = [ ":angle_release_asserts_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" ] all_dependent_configs += [ ":angle_disable_pool_alloc" ]
} }
} }
...@@ -683,7 +690,7 @@ angle_source_set("libANGLE_base") { ...@@ -683,7 +690,7 @@ angle_source_set("libANGLE_base") {
# Windows ARM64 is available since 10.0.16299 so no need to copy # Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox. # d3dcompiler_47.dll because this file is available as inbox.
if (is_win && target_cpu != "arm64") { if (_use_copy_compiler_dll) {
data_deps = [ data_deps = [
":copy_compiler_dll", ":copy_compiler_dll",
] ]
...@@ -1121,45 +1128,47 @@ angle_executable("angle_shader_translator") { ...@@ -1121,45 +1128,47 @@ angle_executable("angle_shader_translator") {
] ]
} }
config("angle_feature_support_config") { if (angle_has_build) {
include_dirs = [ config("angle_feature_support_config") {
"include", include_dirs = [
"src", "include",
] "src",
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ] ]
if (is_debug) { defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ] if (is_debug) {
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
}
} }
}
angle_shared_library("libfeature_support") {
output_name = "libfeature_support${angle_libs_suffix}"
if (is_android) { angle_shared_library("libfeature_support") {
libs = [ "log" ] output_name = "libfeature_support${angle_libs_suffix}"
}
public_configs += [ if (is_android) {
":angle_feature_support_config", libs = [ "log" ]
"${angle_jsoncpp_dir}:jsoncpp_config", }
]
if (is_mac && !is_component_build) { public_configs += [
ldflags = [ ":angle_feature_support_config",
"-install_name", "${angle_jsoncpp_dir}:jsoncpp_config",
"@rpath/${target_name}.dylib",
] ]
}
sources = [ if (is_mac && !is_component_build) {
"src/feature_support_util/feature_support_util.cpp", ldflags = [
"src/feature_support_util/feature_support_util.h", "-install_name",
] "@rpath/${target_name}.dylib",
]
}
deps = [ sources = [
":angle_gpu_info_util", "src/feature_support_util/feature_support_util.cpp",
"${angle_jsoncpp_dir}:jsoncpp", "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) { if (!is_component_build && is_android && symbol_level != 0) {
...@@ -1226,3 +1235,11 @@ if (!is_component_build && is_android && ...@@ -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 @@ ...@@ -5,6 +5,9 @@
# Override for angle_root # Override for angle_root
angle_root = "//" angle_root = "//"
# True if ANGLE can access build/, testing/ and other Chrome folders.
angle_has_build = true
# Overrides for ANGLE's dependencies # Overrides for ANGLE's dependencies
angle_glslang_dir = "//third_party/glslang/src" angle_glslang_dir = "//third_party/glslang/src"
angle_googletest_dir = "//third_party/googletest/src" angle_googletest_dir = "//third_party/googletest/src"
......
...@@ -2,15 +2,32 @@ ...@@ -2,15 +2,32 @@
# 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("//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/angle.gni")
import("//build_overrides/build.gni")
import("//build_overrides/swiftshader.gni") if (angle_has_build) {
import("//testing/test.gni") import("//build/config/dcheck_always_on.gni")
if (is_android) { import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/android/config.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) { if (build_with_chromium) {
...@@ -70,8 +87,9 @@ declare_args() { ...@@ -70,8 +87,9 @@ declare_args() {
# Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714. # Vulkan Validation Layers compatibility issues, see http://crrev/c/1405714.
# Otherwise, API level 24 would have been enough. # Otherwise, API level 24 would have been enough.
angle_enable_vulkan = angle_enable_vulkan =
(is_win && !angle_is_winuwp) || (is_linux && use_x11 && !is_chromeos) || angle_has_build &&
(is_android && ndk_api_level_at_least_26) || is_fuchsia ((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_null = true
angle_enable_essl = true angle_enable_essl = true
angle_enable_glsl = true angle_enable_glsl = true
...@@ -91,21 +109,21 @@ declare_args() { ...@@ -91,21 +109,21 @@ declare_args() {
angle_enable_overlay = false angle_enable_overlay = false
} }
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
}
angle_common_configs = [ angle_common_configs = [
angle_root + ":better_linux_stack_traces", angle_root + ":better_linux_stack_traces",
angle_root + ":extra_warnings", angle_root + ":extra_warnings",
angle_root + ":internal_config", 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 = angle_better_stack_traces =
(is_debug || dcheck_always_on) && is_linux && !is_asan && !is_cfi (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" ] angle_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
# Disabled to enable better stack traces. # Disabled to enable better stack traces.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
# This file houses the build configuration for the ANGLE Vulkan back-end. # This file houses the build configuration for the ANGLE Vulkan back-end.
import("//build_overrides/swiftshader.gni")
import("../../../../gni/angle.gni") import("../../../../gni/angle.gni")
assert(angle_enable_vulkan) 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