@@ -19,13 +19,129 @@ GIT_URL=https://github.com/google/angle/archive/refs/heads/$VER_FULL.tar.gz
19
19
GIT_TAG=v$VER
20
20
21
21
function download() {
22
- . " $DOWNLOADER_SCRIPT "
23
- downloader ${GIT_URL}
24
- tar -xf $VER .tar.gz
25
- mv " angle-chromium-$VER " angle
26
- rm -f $VER .tar.gz
22
+ # . "$DOWNLOADER_SCRIPT"
23
+ # downloader ${GIT_URL}
24
+ # tar -xf $VER.tar.gz
25
+ # mv "angle-chromium-$VER" angle
26
+ # rm -f $VER.tar.gz
27
+
28
+ if [ -d " angle" ]; then
29
+ echo " Removing existing ANGLE directory..."
30
+ rm -rf angle
31
+ fi
32
+
33
+ echo " Cloning ANGLE repository from ${GIT_URL} ..."
34
+
35
+ # Clone the repository with submodules
36
+ git clone --recursive --depth=1 --branch " $VER_FULL " https://github.com/google/angle.git
37
+
38
+ if [ $? -ne 0 ]; then
39
+ echo " Failed to clone ANGLE repository!"
40
+ exit 1
41
+ fi
42
+
43
+ cd angle || exit
44
+
45
+ echo " Checking out branch/tag: $VER_FULL ..."
46
+ git fetch --tags
47
+ git checkout " $VER_FULL "
48
+
49
+ # # Ensure submodules are fully updated
50
+ # echo "Updating ANGLE submodules..."
51
+ # git submodule update --init --recursive
52
+
53
+ case " $TYPE " in
54
+ vs) # Windows (Direct3D, Vulkan)
55
+ REQUIRED_SUBMODULES=(
56
+ " build"
57
+ " buildtools"
58
+ " third_party/dawn"
59
+ " third_party/glslang/src"
60
+ " third_party/vulkan-headers/src"
61
+ " third_party/vulkan-loader/src"
62
+ " third_party/vulkan-tools/src"
63
+ " third_party/vulkan-validation-layers/src"
64
+ " third_party/vulkan_memory_allocator"
65
+ " tools/python"
66
+ )
67
+ ;;
68
+ osx|ios|tvos|xros|catos|watchos) # Apple platforms (Metal, OpenGL)
69
+ REQUIRED_SUBMODULES=(
70
+ " build"
71
+ " buildtools"
72
+ " third_party/dawn"
73
+ " third_party/glslang/src"
74
+ " third_party/EGL-Registry/src"
75
+ " third_party/OpenGL-Registry/src"
76
+ " third_party/spirv-tools/src"
77
+ " tools/python"
78
+ " tools/clang"
79
+ )
80
+ ;;
81
+ android) # Android (Vulkan, GLES)
82
+ REQUIRED_SUBMODULES=(
83
+ " build"
84
+ " buildtools"
85
+ " third_party/android_build_tools"
86
+ " third_party/android_deps"
87
+ " third_party/android_platform"
88
+ " third_party/android_sdk"
89
+ " third_party/dawn"
90
+ " third_party/glslang/src"
91
+ " third_party/vulkan-headers/src"
92
+ " third_party/vulkan-loader/src"
93
+ " third_party/vulkan-tools/src"
94
+ " third_party/vulkan-validation-layers/src"
95
+ " third_party/vulkan_memory_allocator"
96
+ " tools/python"
97
+ " tools/clang"
98
+ " tools/android"
99
+ )
100
+ ;;
101
+ linux) # Linux (OpenGL, Vulkan)
102
+ REQUIRED_SUBMODULES=(
103
+ " build"
104
+ " buildtools"
105
+ " third_party/dawn"
106
+ " third_party/glslang/src"
107
+ " third_party/EGL-Registry/src"
108
+ " third_party/OpenGL-Registry/src"
109
+ " third_party/spirv-tools/src"
110
+ " third_party/wayland"
111
+ " third_party/libdrm/src"
112
+ " tools/python"
113
+ )
114
+ ;;
115
+ emscripten) # WebAssembly (WebGL)
116
+ REQUIRED_SUBMODULES=(
117
+ " build"
118
+ " buildtools"
119
+ " third_party/dawn"
120
+ " third_party/glslang/src"
121
+ " third_party/EGL-Registry/src"
122
+ " third_party/OpenGL-Registry/src"
123
+ " third_party/spirv-tools/src"
124
+ " tools/python"
125
+ )
126
+ ;;
127
+ * )
128
+ echo " Unsupported TYPE: $TYPE "
129
+ exit 1
130
+ ;;
131
+ esac
132
+
133
+ echo " Initializing required submodules..."
134
+ for submodule in " ${REQUIRED_SUBMODULES[@]} " ; do
135
+ git submodule update --init --recursive " $submodule "
136
+ done
137
+
138
+ cd ..
139
+
27
140
}
28
141
142
+
143
+
144
+
29
145
function prepare() {
30
146
# If needed, copy any patch files or configuration scripts.
31
147
# For GN, ANGLE already includes the necessary BUILD.gn files.
@@ -84,6 +200,12 @@ function build() {
84
200
rm -rf build_${TYPE} _${ARCH}
85
201
mkdir -p " build_${TYPE} _${ARCH} "
86
202
203
+ rm -rf out/Debug
204
+ mkdir -p " out/Debug"
205
+
206
+ rm -rf out/Release
207
+ mkdir -p " out/Release"
208
+
87
209
export DEPOT_TOOLS_UPDATE=0
88
210
if [[ " :$PATH :" != * " :$PWD /depot_tools:" * ]]; then
89
211
export PATH=" $PWD /depot_tools:$PATH "
@@ -102,6 +224,7 @@ function build() {
102
224
angle_enable_essl=true
103
225
angle_enable_glsl=true
104
226
angle_enable_cl=false
227
+ is_clang=true
105
228
106
229
is_component_build=false
107
230
is_debug=false
@@ -111,6 +234,7 @@ function build() {
111
234
vs)
112
235
angle_enable_d3d11=true
113
236
angle_enable_vulkan=true
237
+ is_clang=false
114
238
;;
115
239
osx)
116
240
angle_enable_metal=true
@@ -181,18 +305,17 @@ function build() {
181
305
echoInfo " gn --version: [$( gn --version) ]"
182
306
echoInfo " ninja --version: [$( ninja --version) ]"
183
307
echoInfo " Generating GN build files in [build_${TYPE} _${ARCH} ]"
184
- gn gen " build_ ${TYPE} _ ${ARCH} " --args= " $GN_ARGS "
185
- ninja -C " build_ ${ TYPE} _ ${ARCH} " -j ${PARALLEL_MAKE}
186
- if [ $? -ne 0 ] ; then
187
- echo " GN generation failed "
188
- exit 1
308
+
309
+ if [ $ TYPE == " vs " ] ; then
310
+ gn gen out/Debug --sln=angle-debug --ide=vs2022
311
+ else
312
+ gn gen --args= $GN_ARGS out/Debug
189
313
fi
190
- echoInfo " Building ANGLE with Ninja..."
314
+
315
+ autoninja -C out/Debug
316
+
317
+ # ninja -C "out/Debug" -j${PARALLEL_MAKE}
191
318
192
- if [ $? -ne 0 ]; then
193
- echo " Ninja build failed"
194
- exit 1
195
- fi
196
319
}
197
320
198
321
function copy() {
@@ -223,5 +346,8 @@ function copy() {
223
346
224
347
# Clean the GN build output.
225
348
function clean() {
226
- rm -rf out/angle
349
+ if [ -d " build_${TYPE} _${ARCH} " ]; then
350
+ echo " Removing existing build directory: build_${TYPE} _${ARCH} "
351
+ rm -rf " build_${TYPE} _${ARCH} "
352
+ fi
227
353
}
0 commit comments