diff options
author | James Zern <jzern@google.com> | 2014-06-07 12:51:30 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-06-07 12:51:31 -0700 |
commit | b9a569da41adeaa160b29a14438d71a89caac2d5 (patch) | |
tree | 05f0110b9eec7452feca38ce674c7d6fe7da44df /build | |
parent | b447b9d97886cb41067464fd8d54c93a270ea360 (diff) | |
parent | 78d0968e0943f08093269506158dd118ba750aaa (diff) | |
download | libvpx-b9a569da41adeaa160b29a14438d71a89caac2d5.tar libvpx-b9a569da41adeaa160b29a14438d71a89caac2d5.tar.gz libvpx-b9a569da41adeaa160b29a14438d71a89caac2d5.tar.bz2 libvpx-b9a569da41adeaa160b29a14438d71a89caac2d5.zip |
Merge "gen_msvs_*proj.sh: speed up file generation"
Diffstat (limited to 'build')
-rwxr-xr-x | build/make/gen_msvs_proj.sh | 7 | ||||
-rwxr-xr-x | build/make/gen_msvs_vcxproj.sh | 7 | ||||
-rw-r--r-- | build/make/msvs_common.sh | 19 |
3 files changed, 29 insertions, 4 deletions
diff --git a/build/make/gen_msvs_proj.sh b/build/make/gen_msvs_proj.sh index 660436d3a..f1cc04ea5 100755 --- a/build/make/gen_msvs_proj.sh +++ b/build/make/gen_msvs_proj.sh @@ -176,7 +176,8 @@ for opt in "$@"; do -*) die_unknown $opt ;; *) - file_list[${#file_list[@]}]="$(fix_path $opt)" + # The paths in file_list are fixed outside of the loop. + file_list[${#file_list[@]}]="$opt" case "$opt" in *.asm) uses_asm=true ;; @@ -184,6 +185,10 @@ for opt in "$@"; do ;; esac done + +# Make one call to fix_path for file_list to improve performance. +fix_file_list + outfile=${outfile:-/dev/stdout} guid=${guid:-`generate_uuid`} asm_use_custom_step=false diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh index 4ae511e54..eee354dc7 100755 --- a/build/make/gen_msvs_vcxproj.sh +++ b/build/make/gen_msvs_vcxproj.sh @@ -198,7 +198,8 @@ for opt in "$@"; do -*) die_unknown $opt ;; *) - file_list[${#file_list[@]}]="$(fix_path $opt)" + # The paths in file_list are fixed outside of the loop. + file_list[${#file_list[@]}]="$opt" case "$opt" in *.asm|*.s) uses_asm=true ;; @@ -206,6 +207,10 @@ for opt in "$@"; do ;; esac done + +# Make one call to fix_path for file_list to improve performance. +fix_file_list + outfile=${outfile:-/dev/stdout} guid=${guid:-`generate_uuid`} asm_use_custom_step=false diff --git a/build/make/msvs_common.sh b/build/make/msvs_common.sh index eb2eb7bcf..90c14888c 100644 --- a/build/make/msvs_common.sh +++ b/build/make/msvs_common.sh @@ -13,7 +13,7 @@ if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \ && cygpath --help >/dev/null 2>&1; then FIXPATH='cygpath -m' else - FIXPATH='echo' + FIXPATH='echo_path' fi die() { @@ -27,8 +27,23 @@ die_unknown(){ exit 1 } +echo_path() { + for path; do + echo "$path" + done +} + +# Output one, possibly changed based on the system, path per line. fix_path() { - $FIXPATH "$1" + $FIXPATH "$@" +} + +# Corrects the paths in file_list in one pass for efficiency. +fix_file_list() { + # TODO(jzern): this could be more generic and take the array as a param. + files=$(fix_path "${file_list[@]}") + local IFS=$'\n' + file_list=($files) } generate_uuid() { |