| 1 |
# Copyright (C) 2020 The Khronos Group Inc. |
| 2 |
# |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without |
| 6 |
# modification, are permitted provided that the following conditions |
| 7 |
# are met: |
| 8 |
# |
| 9 |
# Redistributions of source code must retain the above copyright |
| 10 |
# notice, this list of conditions and the following disclaimer. |
| 11 |
# |
| 12 |
# Redistributions in binary form must reproduce the above |
| 13 |
# copyright notice, this list of conditions and the following |
| 14 |
# disclaimer in the documentation and/or other materials provided |
| 15 |
# with the distribution. |
| 16 |
# |
| 17 |
# Neither the name of The Khronos Group Inc. nor the names of its |
| 18 |
# contributors may be used to endorse or promote products derived |
| 19 |
# from this software without specific prior written permission. |
| 20 |
# |
| 21 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 |
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 |
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 24 |
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 25 |
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 26 |
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 27 |
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 |
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 29 |
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 30 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 31 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 32 |
# POSSIBILITY OF SUCH DAMAGE. |
| 33 |
|
| 34 |
# This file defines Glslang's build infra dependencies for GN builds. |
| 35 |
# It assumes you have already have the source files for Glslang |
| 36 |
# *and* its dependencies (as downloaded by ./update_glslang_sources.py) |
| 37 |
|
| 38 |
# Usage: |
| 39 |
# 1. Get Chromium depot_tools, and put it in your path. |
| 40 |
# See https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up |
| 41 |
# |
| 42 |
# 2. From the Glslang source tree: |
| 43 |
# |
| 44 |
# # Get additional build tooling, using the info in the DEPS file. |
| 45 |
# gclient sync --gclientfile=standalone.gclient |
| 46 |
# |
| 47 |
# 3. One of the tools downloaded in the previous step is the binary for 'gn'. |
| 48 |
# Put it on your path. |
| 49 |
# |
| 50 |
# # This is for Linux amd64 environments: |
| 51 |
# PATH=$(pwd)/build/linux64:$PATH |
| 52 |
# |
| 53 |
# 3. Create a build tree with Ninja build recipes. |
| 54 |
# |
| 55 |
# gn gen out/Debug |
| 56 |
# |
| 57 |
# # Or disable HLSL support: |
| 58 |
# gn gen out/Debug-no-hlsl --args="glslang_enable_hlsl=false" |
| 59 |
# |
| 60 |
# # Or make a release build without HLSL support: |
| 61 |
# gn gen out/Release --args="glslang_enable_hlsl=false is_debug=false" |
| 62 |
# |
| 63 |
# 4. Use ninja to build the project |
| 64 |
# |
| 65 |
# ninja -C out/Debug |
| 66 |
|
| 67 |
use_relative_paths = True |
| 68 |
|
| 69 |
gclient_gn_args_file = 'build/config/gclient_args.gni' |
| 70 |
|
| 71 |
# Emit this vars for use in .gn and .gni files |
| 72 |
gclient_gn_args = [ |
| 73 |
# Needed by //build/toolchain/linux/BUILD.gn |
| 74 |
# which was needed by 'action' in ./BUILD.gn |
| 75 |
'build_with_chromium', |
| 76 |
] |
| 77 |
|
| 78 |
git_dependencies = 'SYNC' |
| 79 |
|
| 80 |
vars = { |
| 81 |
# Repo sources |
| 82 |
'chromium_git': 'https://chromium.googlesource.com', |
| 83 |
|
| 84 |
# Building context |
| 85 |
'build_with_chromium': False, |
| 86 |
'glslang_standalone': True, |
| 87 |
|
| 88 |
# Commits |
| 89 |
'glslang_gn_version': 'git_revision:ec56d4d935a0e2ab9d52b88dd00c93ec51233055', |
| 90 |
'glslang_build_version': '2316930a88b15a036fa5f72e2b2c2ba08e2904a0', |
| 91 |
} |
| 92 |
|
| 93 |
deps = { |
| 94 |
# Get buildtools. |
| 95 |
# We need the 'gn' binary. |
| 96 |
'buildtools': { |
| 97 |
'url': '{chromium_git}/chromium/src/buildtools@11cc2bd83053cb790b7516aa3eb3f3935fb05a0e', |
| 98 |
'condition': 'glslang_standalone', |
| 99 |
}, |
| 100 |
'buildtools/linux64': { |
| 101 |
'packages': [{ |
| 102 |
'package': 'gn/gn/linux-${{arch}}', |
| 103 |
'version': Var('glslang_gn_version'), |
| 104 |
}], |
| 105 |
'dep_type': 'cipd', |
| 106 |
'condition': 'glslang_standalone and host_os == "linux"', |
| 107 |
}, |
| 108 |
'buildtools/mac': { |
| 109 |
'packages': [{ |
| 110 |
'package': 'gn/gn/mac-${{arch}}', |
| 111 |
'version': Var('glslang_gn_version'), |
| 112 |
}], |
| 113 |
'dep_type': 'cipd', |
| 114 |
'condition': 'glslang_standalone and host_os == "mac"', |
| 115 |
}, |
| 116 |
'buildtools/win': { |
| 117 |
'packages': [{ |
| 118 |
'package': 'gn/gn/windows-amd64', |
| 119 |
'version': Var('glslang_gn_version'), |
| 120 |
}], |
| 121 |
'dep_type': 'cipd', |
| 122 |
'condition': 'glslang_standalone and host_os == "win"', |
| 123 |
}, |
| 124 |
|
| 125 |
# Get //build from Chromium. |
| 126 |
# It contains the generic //build/config/BUILDCONFIG.gn that sets up most rules |
| 127 |
# for C++ compilation. |
| 128 |
'build': { |
| 129 |
'url': '{chromium_git}/chromium/src/build@{glslang_build_version}', |
| 130 |
'condition': 'glslang_standalone', |
| 131 |
}, |
| 132 |
} |
| 133 |
|
| 134 |
hooks = [ |
| 135 |
# The Chromium BUILDCONFIG.gn has a false dependency on the sysroots. |
| 136 |
# Pull the compilers and system libraries for hermetic builds |
| 137 |
{ |
| 138 |
'name': 'sysroot_x86', |
| 139 |
'pattern': '.', |
| 140 |
'condition': 'glslang_standalone and checkout_linux and checkout_x86', |
| 141 |
'action': ['vpython3', 'build/linux/sysroot_scripts/install-sysroot.py', |
| 142 |
'--arch=x86'], |
| 143 |
}, |
| 144 |
{ |
| 145 |
'name': 'sysroot_x64', |
| 146 |
'pattern': '.', |
| 147 |
'condition': 'glslang_standalone and checkout_linux and checkout_x64', |
| 148 |
'action': ['vpython3', 'build/linux/sysroot_scripts/install-sysroot.py', |
| 149 |
'--arch=x64'], |
| 150 |
}, |
| 151 |
] |
| 152 |
|
| 153 |
recursedeps = [ |
| 154 |
'buildtools', |
| 155 |
] |