Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: generate_gypi.sh

Issue 1272583003: Break GN targets apart by library (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« BUILD.gn ('K') | « BUILD.gn ('k') | libvpx_srcs.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash -e 1 #!/bin/bash -e
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # This script is used to generate .gypi, .gni files and files in the 7 # This script is used to generate .gypi, .gni files and files in the
8 # config/platform directories needed to build libvpx. 8 # config/platform directories needed to build libvpx.
9 # Every time libvpx source code is updated just run this script. 9 # Every time libvpx source code is updated just run this script.
10 # 10 #
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 write_gypi source_list "$BASE_DIR/$2.gypi" 243 write_gypi source_list "$BASE_DIR/$2.gypi"
244 244
245 # All the files are in a single "element." Check if the first element has 245 # All the files are in a single "element." Check if the first element has
246 # length 0. 246 # length 0.
247 if [ 0 -ne ${#intrinsic_list} ]; then 247 if [ 0 -ne ${#intrinsic_list} ]; then
248 write_intrinsics_gypi intrinsic_list[@] "$BASE_DIR/$2_intrinsics.gypi" 248 write_intrinsics_gypi intrinsic_list[@] "$BASE_DIR/$2_intrinsics.gypi"
249 fi 249 fi
250 250
251 # Write a single .gni file that includes all source files for all archs. 251 # Write a single .gni file that includes all source files for all archs.
252 if [ 0 -ne ${#x86_list} ]; then 252 # First all the non-specific files not found in vp8, vp9, or vpx_dsp
253 local c_sources=$(echo "$source_list" | egrep '.(c|h)$') 253 local c_sources=$(echo "$source_list" | \
254 local assembly_sources=$(echo "$source_list" | egrep '.asm$') 254 egrep -v "^vp(8|9|x_dsp)" | \
255 local mmx_sources=$(echo "$intrinsic_list" | grep '_mmx\.c$') 255 egrep ".(c|h)$")
256 local sse2_sources=$(echo "$intrinsic_list" | grep '_sse2\.c$') 256 local assembly_sources=$(echo "$source_list" | \
257 local sse3_sources=$(echo "$intrinsic_list" | grep '_sse3\.c$') 257 egrep -v "^vp(8|9|x_dsp)" | \
258 local ssse3_sources=$(echo "$intrinsic_list" | grep '_ssse3\.c$') 258 egrep ".asm$")
259 local sse4_1_sources=$(echo "$intrinsic_list" | grep '_sse4\.c$') 259 write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni"
260 local avx_sources=$(echo "$intrinsic_list" | grep '_avx\.c$') 260 write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni"
261 local avx2_sources=$(echo "$intrinsic_list" | grep '_avx2\.c$')
262 261
263 write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" 262 # Break out the remaining files by specific targets. GN does not
264 write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" 263 # disambiguate by path so this is the only way to avoid name conflicts.
265 write_gni mmx_sources $2_mmx "$BASE_DIR/libvpx_srcs.gni" 264 for library in vp8 vp9 vpx_dsp; do
266 write_gni sse2_sources $2_sse2 "$BASE_DIR/libvpx_srcs.gni" 265 if [ 0 -ne ${#x86_list} ]; then
267 write_gni sse3_sources $2_sse3 "$BASE_DIR/libvpx_srcs.gni" 266 local c_sources=$(echo "$source_list" | egrep "^${library}.+.(c|h)$")
268 write_gni ssse3_sources $2_ssse3 "$BASE_DIR/libvpx_srcs.gni" 267 local assembly_sources=$(echo "$source_list" | egrep "^${library}.+.asm$")
269 write_gni sse4_1_sources $2_sse4_1 "$BASE_DIR/libvpx_srcs.gni" 268 local mmx_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_mmx\.c$" )
270 write_gni avx_sources $2_avx "$BASE_DIR/libvpx_srcs.gni" 269 local sse2_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_sse2\.c $")
271 write_gni avx2_sources $2_avx2 "$BASE_DIR/libvpx_srcs.gni" 270 local sse3_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_sse3\.c $")
272 else 271 local ssse3_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_ssse3\ .c$")
273 local c_sources=$(echo "$source_list" | egrep '.(c|h)$') 272 local sse4_1_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_sse4\ .c$")
274 local assembly_sources=$(echo -e "$source_list\n$intrinsic_list" | \ 273 local avx_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_avx\.c$" )
275 egrep '.asm$') 274 local avx2_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_avx2\.c $")
276 local neon_sources=$(echo "$intrinsic_list" | grep '_neon\.c$') 275
277 write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" 276 write_gni c_sources ${library}_$2 "$BASE_DIR/libvpx_srcs.gni"
278 write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" 277 write_gni assembly_sources ${library}_$2_assembly "$BASE_DIR/libvpx_srcs.g ni"
279 if [ 0 -ne ${#neon_sources} ]; then 278 write_gni mmx_sources ${library}_$2_mmx "$BASE_DIR/libvpx_srcs.gni"
280 write_gni neon_sources $2_neon "$BASE_DIR/libvpx_srcs.gni" 279 write_gni sse2_sources ${library}_$2_sse2 "$BASE_DIR/libvpx_srcs.gni"
280 write_gni sse3_sources ${library}_$2_sse3 "$BASE_DIR/libvpx_srcs.gni"
281 write_gni ssse3_sources ${library}_$2_ssse3 "$BASE_DIR/libvpx_srcs.gni"
282 write_gni sse4_1_sources ${library}_$2_sse4_1 "$BASE_DIR/libvpx_srcs.gni"
283 write_gni avx_sources ${library}_$2_avx "$BASE_DIR/libvpx_srcs.gni"
284 write_gni avx2_sources ${library}_$2_avx2 "$BASE_DIR/libvpx_srcs.gni"
285 else
286 local c_sources=$(echo "$source_list" | egrep "^${library}.+.(c|h)$")
287 local assembly_sources=$(echo -e "$source_list\n$intrinsic_list" | \
288 egrep "^${library}.+.asm$")
289 local neon_sources=$(echo "$intrinsic_list" | egrep "^${library}.+_neon\.c $")
290 write_gni c_sources ${library}_$2 "$BASE_DIR/libvpx_srcs.gni"
291 write_gni assembly_sources ${library}_$2_assembly "$BASE_DIR/libvpx_srcs.g ni"
292 if [ 0 -ne ${#neon_sources} ]; then
293 write_gni neon_sources ${library}_$2_neon "$BASE_DIR/libvpx_srcs.gni"
294 fi
281 fi 295 fi
282 fi 296 done
283 } 297 }
284 298
285 # Clean files from previous make. 299 # Clean files from previous make.
286 function make_clean { 300 function make_clean {
287 make clean > /dev/null 301 make clean > /dev/null
288 rm -f libvpx_srcs.txt 302 rm -f libvpx_srcs.txt
289 } 303 }
290 304
291 # Lint a pair of vpx_config.h and vpx_config.asm to make sure they match. 305 # Lint a pair of vpx_config.h and vpx_config.asm to make sure they match.
292 # $1 - Header file directory. 306 # $1 - Header file directory.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 config=$(print_config_basic linux/generic) 538 config=$(print_config_basic linux/generic)
525 make_clean 539 make_clean
526 make libvpx_srcs.txt target=libs $config > /dev/null 540 make libvpx_srcs.txt target=libs $config > /dev/null
527 convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic 541 convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic
528 542
529 echo "Remove temporary directory." 543 echo "Remove temporary directory."
530 cd $BASE_DIR 544 cd $BASE_DIR
531 rm -rf $TEMP_DIR 545 rm -rf $TEMP_DIR
532 546
533 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? 547 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel?
OLDNEW
« BUILD.gn ('K') | « BUILD.gn ('k') | libvpx_srcs.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698