ref: a757a99c8e6fb54b41996f506b07d39c6062105b
parent: 7f83a3bcdc3fd5ed4f85de0a406cd1dcda9e2382
author: James Zern <jzern@google.com>
date: Tue Apr 22 16:47:39 EDT 2014
gen_msvs_proj.sh: support cygwin style paths Change-Id: I674337a775651d7d9c9aa9fee755deaed11c104e
--- a/build/make/gen_msvs_proj.sh
+++ b/build/make/gen_msvs_proj.sh
@@ -14,6 +14,12 @@
self_basename=${self##*/}self_dirname=$(dirname "$0")
EOL=$'\n'
+if [ "$(uname -o 2>/dev/null)" = "Cygwin" ] \
+ && cygpath --help >/dev/null 2>&1; then
+ FIXPATH='cygpath -m'
+else
+ FIXPATH='echo'
+fi
show_help() {cat <<EOF
@@ -54,6 +60,10 @@
exit 1
}
+fix_path() {+ $FIXPATH "$1"
+}
+
generate_uuid() {local hex="0123456789ABCDEF"
local i
@@ -143,8 +153,8 @@
if [ "${f##*.}" == "$pat" ]; thenunset file_list[i]
- objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,/,_,g')- open_tag File RelativePath="./$f"
+ objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,[:/],_,g')+ open_tag File RelativePath="$f"
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
for plat in "${platforms[@]}"; do@@ -211,7 +221,7 @@
;;
--lib) proj_kind="lib"
;;
- --src-path-bare=*) src_path_bare="$optval"
+ --src-path-bare=*) src_path_bare=$(fix_path "$optval")
;;
--static-crt) use_static_runtime=true
;;
@@ -226,8 +236,10 @@
;;
-I*)
opt="${opt%/}"- incs="${incs}${incs:+;}"${opt##-I}""- yasmincs="${yasmincs} ${opt}"+ opt=${opt##-I}+ opt=$(fix_path "$opt")
+ incs="${incs}${incs:+;}"${opt}""+ yasmincs="${yasmincs} -I${opt}";;
-D*) defines="${defines}${defines:+;}${opt##-D}";;
@@ -236,9 +248,11 @@
libdirs="${libdirs}${libdirs:+;}"\$(OutDir)""else
# Also try directories for this platform/configuration
- libdirs="${libdirs}${libdirs:+;}"${opt##-L}""- libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)/\$(ConfigurationName)""- libdirs="${libdirs}${libdirs:+;}"${opt##-L}/\$(PlatformName)""+ opt=${opt##-L}+ opt=$(fix_path "$opt")
+ libdirs="${libdirs}${libdirs:+;}"${opt}""+ libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)/\$(ConfigurationName)""+ libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)""fi
;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"@@ -246,7 +260,7 @@
-*) die_unknown $opt
;;
*)
- file_list[${#file_list[@]}]="$opt"+ file_list[${#file_list[@]}]="$(fix_path $opt)"case "$opt" in
*.asm) uses_asm=true
;;
--
⑨