Commit d0ef13a2 by Frank Henigman Committed by Commit Bot

Stand-alone build with gn.

This should do the same things as the stand-alone gyp build, but with gn. You should switch to gn as gyp support will go away. You need a recent enough version of gn. If yours is too old try this one: ./buildtools/linux64/gn If "gclient sync" or anything fails with an ImportError on gyp stuff, try running it with the following PYTHONPATH in the environment: PYTHONPATH=tools/gyp/pylib BUG=angleproject:1569 Change-Id: I56d19bec2d8b649a7bd65062c656cbfc69ea3dd8 Reviewed-on: https://chromium-review.googlesource.com/642588Reviewed-by: 's avatarFrank Henigman <fjhenigman@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
parent d042fba4
......@@ -22,17 +22,20 @@
.gclient
.gclient_entries
/src/tests/third_party/gles_conformance_tests
/testing
/third_party/cherry
/third_party/deqp/src
/third_party/glslang-angle/src
/third_party/googletest/src
/third_party/gyp
/third_party/libpng/src
/third_party/llvm-build
/third_party/spirv-headers/src
/third_party/spirv-tools-angle/src
/third_party/vulkan-validation-layers/src
/third_party/zlib
angle_internal
build
buildtools/
debug.txt
Debug/
......@@ -50,3 +53,5 @@ Release_ARM/
Release_Win32/
Release_x64/
TestResults.qpa
tools/clang
tools/gyp
# Copyright 2017 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.
#
# This file is used when gn runs in this directory (or a lower directory
# and searching upward ends here). See "gn help dotfile."
# As a result this file will only affect stand-alone ANGLE builds,
# not chromium builds.
# Location of the build configuration file.
buildconfig = "//build/config/BUILDCONFIG.gn"
# The secondary source root is a parallel directory tree where
# GN build files are placed when they can not be placed directly
# in the source tree, e.g. for third party source trees.
secondary_source = "//build/secondary/"
# These are the targets to check headers for by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will have
# their includes checked for proper dependencies when you run either
# "gn check" or "gn gen --check".
check_targets = []
# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
# discouraged except for gypi_to_gn calls.
exec_script_whitelist = [
"//build/config/android/BUILD.gn",
"//build/config/android/config.gni",
"//build/config/android/internal_rules.gni",
"//build/config/android/rules.gni",
"//build/config/BUILD.gn",
"//build/config/compiler/BUILD.gn",
"//build/config/ios/ios_sdk.gni",
"//build/config/linux/atk/BUILD.gn",
"//build/config/linux/BUILD.gn",
"//build/config/linux/pkg_config.gni",
"//build/config/mac/mac_sdk.gni",
"//build/config/posix/BUILD.gn",
"//build/config/sysroot.gni",
"//build/config/win/BUILD.gn",
"//build/config/win/visual_studio_version.gni",
"//build/gn_helpers.py",
"//build/gypi_to_gn.py",
"//build/toolchain/concurrent_links.gni",
"//build/toolchain/gcc_toolchain.gni",
"//build/toolchain/mac/BUILD.gn",
"//build/toolchain/win/BUILD.gn",
"//build/util/branding.gni",
"//build/util/version.gni",
"//BUILD.gn",
"//src/tests/BUILD.gn",
"//src/vulkan_support/BUILD.gn",
]
default_args = {
use_custom_libcxx = false
clang_use_chrome_plugins = false
build_angle_deqp_tests = true
use_sysroot = false
}
......@@ -7,8 +7,7 @@ import("//build/config/dcheck_always_on.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/angle/gni/angle.gni")
import("//ui/ozone/ozone.gni")
import("gni/angle.gni")
declare_args() {
# Use the PCI lib to collect GPU information on Linux.
......@@ -16,6 +15,18 @@ declare_args() {
(use_x11 || use_ozone)
}
if (!build_with_chromium) {
group("all") {
testonly = true
deps = [
":angle_shader_translator",
":translator_fuzzer",
"//samples:all",
"//src/tests:all",
]
}
}
if (ozone_platform_gbm) {
pkg_config("libdrm") {
packages = [ "libdrm" ]
......@@ -70,6 +81,7 @@ config("internal_config") {
config("extra_warnings") {
cflags = []
# Enable more default warnings on Windows.
if (is_win) {
cflags += [
......@@ -80,7 +92,7 @@ config("extra_warnings") {
}
if (is_clang) {
# Remove when crbug.com/428099 is resolved.
cflags += ["-Winconsistent-missing-override"]
cflags += [ "-Winconsistent-missing-override" ]
}
}
......@@ -487,7 +499,7 @@ static_library("libANGLE") {
if (is_linux) {
sources += rebase_path(gles_gypi.libangle_vulkan_xcb_sources, ".", "src")
}
deps += [ "//third_party/angle/src/vulkan_support:angle_vulkan" ]
deps += [ "src/vulkan_support:angle_vulkan" ]
}
if (angle_enable_null) {
......
......@@ -5,8 +5,14 @@ vars = {
deps = {
'build':
Var('chromium_git') + '/chromium/src/build.git' + '@' + 'cdd940cfcab2d20be1e6fd49e3580e531a5e7305',
'buildtools':
Var('chromium_git') + '/chromium/buildtools.git' + '@' + '98f00fa10dbad2cdbb2e297a66c3d6d5bc3994f3',
Var('chromium_git') + '/chromium/buildtools.git' + '@' + 'e043d81e9185a2445fa3ec3fc34a4f69b58d4969',
'testing':
Var('chromium_git') + '/chromium/src/testing' + '@' + 'd57c35d68320b906c43ad3f0ea5d84da3d06f45d',
# Cherry is a dEQP management GUI written in Go. We use it for viewing test results.
'third_party/cherry':
......@@ -38,6 +44,13 @@ deps = {
'third_party/zlib':
Var('chromium_git') + '/chromium/src/third_party/zlib' + '@' + '24ab14872e8e068ba08cc31cc3d43bcc6d5cb832',
'tools/clang':
Var('chromium_git') + '/chromium/src/tools/clang.git' + '@' + 'dce401419c4281e2aad72a9bafb885a9fb9aec59',
'tools/gyp':
Var('chromium_git') + '/external/gyp' + '@' + 'c6f471687407bf28ddfc63f1a8f47aeb7bf54edc',
}
hooks = [
......@@ -110,6 +123,13 @@ hooks = [
],
},
{
# Pull clang if needed or requested via GYP_DEFINES.
# Note: On Win, this should run after win_toolchain, as it may use it.
'name': 'clang',
'pattern': '.',
'action': ['python', 'tools/clang/scripts/update.py', '--if-needed'],
},
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
'pattern': '.',
'action': ['python', 'gyp/gyp_angle'],
......
# Copyright (c) 2017 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.
build_with_chromium = false
ignore_elf32_limitations = true
linux_use_bundled_binutils_override = false
use_system_xcode = true
......@@ -2,8 +2,20 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build_overrides/build.gni")
import("//build/config/ui.gni") # import the use_x11 variable
import("//ui/ozone/ozone.gni")
if (build_with_chromium) {
angle_root = "//third_party/angle"
import("//ui/ozone/ozone.gni")
} else {
angle_root = "//"
declare_args() {
ozone_platform_gbm = false
}
}
angle_enable_d3d9 = false
angle_enable_d3d11 = false
......
......@@ -13,7 +13,7 @@ import sys
script_dir = os.path.dirname(__file__)
angle_dir = os.path.normpath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(angle_dir, 'third_party', 'gyp', 'pylib'))
sys.path.insert(0, os.path.join(angle_dir, 'tools', 'gyp', 'pylib'))
import gyp
def appendCommonArgs(args):
......
# Copyright 2017 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.
executable("shader_translator") {
sources = [ "shader_translator/shader_translator.cpp", ]
include_dirs = [ "../include", ]
deps = [ "../:translator", ]
}
config("sample_util_config") {
include_dirs = [ "sample_util" ]
}
static_library("sample_util") {
sources = [
"sample_util/SampleApplication.cpp",
"sample_util/SampleApplication.h",
"sample_util/texture_utils.cpp",
"sample_util/texture_utils.h",
"sample_util/tga_utils.cpp",
"sample_util/tga_utils.h",
]
deps = [
"../:angle_common",
"../:angle_util",
"../:libEGL",
"../:libGLESv2",
]
public_configs = [ ":sample_util_config" ]
}
template("angle_sample") {
if (defined(invoker.data)) {
copy(target_name + "_data") {
sources = invoker.data
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
executable(target_name) {
deps = [
":sample_util",
"../:angle_util",
]
if (defined(invoker.data)) {
deps += [ ":${target_name}_data" ]
}
sources = invoker.sources
}
}
angle_sample("hello_triangle") {
sources = [
"hello_triangle/HelloTriangle.cpp",
]
}
angle_sample("mip_map_2d") {
sources = [
"mip_map_2d/MipMap2D.cpp",
]
}
angle_sample("multi_texture") {
sources = [
"multi_texture/MultiTexture.cpp",
]
data = [
"multi_texture/basemap.tga",
"multi_texture/lightmap.tga",
]
}
angle_sample("multi_window") {
sources = [
"multi_window/MultiWindow.cpp",
]
}
angle_sample("multiple_draw_buffers") {
sources = [
"multiple_draw_buffers/MultipleDrawBuffers.cpp",
]
data = [
"multiple_draw_buffers/multiple_draw_buffers_copy_fs.glsl",
"multiple_draw_buffers/multiple_draw_buffers_fs.glsl",
"multiple_draw_buffers/multiple_draw_buffers_vs.glsl",
]
}
angle_sample("multiview") {
sources = [
"multiview/Multiview.cpp",
]
}
angle_sample("particle_system") {
sources = [
"particle_system/ParticleSystem.cpp",
]
data = [
"particle_system/smoke.tga",
]
}
angle_sample("post_sub_buffer") {
sources = [
"post_sub_buffer/PostSubBuffer.cpp",
]
}
angle_sample("simple_instancing") {
sources = [
"simple_instancing/SimpleInstancing.cpp",
]
}
angle_sample("simple_texture_2d") {
sources = [
"simple_texture_2d/SimpleTexture2D.cpp",
]
}
angle_sample("simple_texture_cubemap") {
sources = [
"simple_texture_cubemap/SimpleTextureCubemap.cpp",
]
}
angle_sample("simple_vertex_shader") {
sources = [
"simple_vertex_shader/SimpleVertexShader.cpp",
]
}
angle_sample("stencil_operations") {
sources = [
"stencil_operations/StencilOperations.cpp",
]
}
angle_sample("tex_redef_microbench") {
sources = [
"tex_redef_microbench/TexRedefMicroBench.cpp",
]
}
angle_sample("texture_wrap") {
sources = [
"texture_wrap/TextureWrap.cpp",
]
}
angle_sample("tri_fan_microbench") {
sources = [
"tri_fan_microbench/TriFanMicroBench.cpp",
]
}
angle_sample("window_test") {
sources = [
"WindowTest/WindowTest.cpp",
]
}
group("all") {
testonly = true
deps = [
":hello_triangle",
":mip_map_2d",
":multi_texture",
":multi_window",
":multiple_draw_buffers",
":multiview",
":particle_system",
":post_sub_buffer",
":sample_util",
":simple_instancing",
":simple_texture_2d",
":simple_texture_cubemap",
":simple_vertex_shader",
":stencil_operations",
":tex_redef_microbench",
":texture_wrap",
":tri_fan_microbench",
":window_test",
]
}
......@@ -4,7 +4,14 @@
# TODO(jmadill): Redo the file entirely when we have standalone GN ANGLE.
third_party_dir = "../../../../third_party"
import("../../gni/angle.gni")
if (build_with_chromium) {
third_party_dir = "../../../../third_party"
} else {
third_party_dir = "../../third_party"
}
glslang_dir = "$third_party_dir/glslang-angle/src"
spirv_headers_dir = "$third_party_dir/spirv-headers/src"
spirv_tools_dir = "$third_party_dir/spirv-tools-angle/src"
......@@ -419,7 +426,7 @@ layers = [
]
action("vulkan_gen_json_files") {
script = "$third_party_dir/angle/scripts/generate_vulkan_layers_json.py"
script = "$angle_root/scripts/generate_vulkan_layers_json.py"
if (is_win) {
sources =
rebase_path(vulkan_gypi.vulkan_gen_json_files_sources_win, ".", "src")
......
# Copyright (c) 2017 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.
config("libpng_config") {
include_dirs = [ "src" ]
}
static_library("libpng") {
sources = [
"src/png.c",
"src/pngerror.c",
"src/pngget.c",
"src/pngmem.c",
"src/pngpread.c",
"src/pngread.c",
"src/pngrio.c",
"src/pngrtran.c",
"src/pngrutil.c",
"src/pngset.c",
"src/pngtrans.c",
"src/pngwio.c",
"src/pngwrite.c",
"src/pngwtran.c",
"src/pngwutil.c",
]
if (is_win) {
cflags = [ "/wd4028" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
public_configs = [ ":libpng_config" ]
deps = [
"//third_party/zlib:zlib",
]
}
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