Merge changes I2f05a5d9,I674337a7

* changes:
  gen_msvs_vcxproj.sh: support cygwin style paths
  gen_msvs_proj.sh: support cygwin style paths
This commit is contained in:
James Zern 2014-04-23 13:04:15 -07:00 committed by Gerrit Code Review
commit dddc3c6906
2 changed files with 50 additions and 22 deletions

View File

@ -14,6 +14,12 @@ self=$0
self_basename=${self##*/} self_basename=${self##*/}
self_dirname=$(dirname "$0") self_dirname=$(dirname "$0")
EOL=$'\n' 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() { show_help() {
cat <<EOF cat <<EOF
@ -54,6 +60,10 @@ die_unknown(){
exit 1 exit 1
} }
fix_path() {
$FIXPATH "$1"
}
generate_uuid() { generate_uuid() {
local hex="0123456789ABCDEF" local hex="0123456789ABCDEF"
local i local i
@ -143,8 +153,8 @@ generate_filter() {
if [ "${f##*.}" == "$pat" ]; then if [ "${f##*.}" == "$pat" ]; then
unset file_list[i] unset file_list[i]
objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,/,_,g') objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,[:/],_,g')
open_tag File RelativePath="./$f" open_tag File RelativePath="$f"
if [ "$pat" == "asm" ] && $asm_use_custom_step; then if [ "$pat" == "asm" ] && $asm_use_custom_step; then
for plat in "${platforms[@]}"; do for plat in "${platforms[@]}"; do
@ -211,7 +221,7 @@ for opt in "$@"; do
;; ;;
--lib) proj_kind="lib" --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 --static-crt) use_static_runtime=true
;; ;;
@ -226,8 +236,10 @@ for opt in "$@"; do
;; ;;
-I*) -I*)
opt="${opt%/}" opt="${opt%/}"
incs="${incs}${incs:+;}&quot;${opt##-I}&quot;" opt=${opt##-I}
yasmincs="${yasmincs} ${opt}" opt=$(fix_path "$opt")
incs="${incs}${incs:+;}&quot;${opt}&quot;"
yasmincs="${yasmincs} -I${opt}"
;; ;;
-D*) defines="${defines}${defines:+;}${opt##-D}" -D*) defines="${defines}${defines:+;}${opt##-D}"
;; ;;
@ -236,9 +248,11 @@ for opt in "$@"; do
libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;" libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
else else
# Also try directories for this platform/configuration # Also try directories for this platform/configuration
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}&quot;" opt=${opt##-L}
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)/\$(ConfigurationName)&quot;" opt=$(fix_path "$opt")
libdirs="${libdirs}${libdirs:+;}&quot;${opt##-L}/\$(PlatformName)&quot;" libdirs="${libdirs}${libdirs:+;}&quot;${opt}&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)/\$(ConfigurationName)&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)&quot;"
fi fi
;; ;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib" -l*) libs="${libs}${libs:+ }${opt##-l}.lib"
@ -246,7 +260,7 @@ for opt in "$@"; do
-*) die_unknown $opt -*) die_unknown $opt
;; ;;
*) *)
file_list[${#file_list[@]}]="$opt" file_list[${#file_list[@]}]="$(fix_path $opt)"
case "$opt" in case "$opt" in
*.asm) uses_asm=true *.asm) uses_asm=true
;; ;;

View File

@ -14,6 +14,12 @@ self=$0
self_basename=${self##*/} self_basename=${self##*/}
self_dirname=$(dirname "$0") self_dirname=$(dirname "$0")
EOL=$'\n' 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() { show_help() {
cat <<EOF cat <<EOF
@ -55,6 +61,10 @@ die_unknown(){
exit 1 exit 1
} }
fix_path() {
$FIXPATH "$1"
}
generate_uuid() { generate_uuid() {
local hex="0123456789ABCDEF" local hex="0123456789ABCDEF"
local i local i
@ -154,7 +164,7 @@ generate_filter() {
if [ "${f##*.}" == "$pat" ]; then if [ "${f##*.}" == "$pat" ]; then
unset file_list[i] unset file_list[i]
objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,/,_,g') objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,[:/],_,g')
if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then
# Avoid object file name collisions, i.e. vpx_config.c and # Avoid object file name collisions, i.e. vpx_config.c and
@ -162,7 +172,7 @@ generate_filter() {
# this additional suffix. # this additional suffix.
objf=${objf%.obj}_asm.obj objf=${objf%.obj}_asm.obj
open_tag CustomBuild \ open_tag CustomBuild \
Include=".\\$f" Include="$f"
for plat in "${platforms[@]}"; do for plat in "${platforms[@]}"; do
for cfg in Debug Release; do for cfg in Debug Release; do
tag_content Message "Assembling %(Filename)%(Extension)" \ tag_content Message "Assembling %(Filename)%(Extension)" \
@ -177,7 +187,7 @@ generate_filter() {
elif [ "$pat" == "c" ] || \ elif [ "$pat" == "c" ] || \
[ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then
open_tag ClCompile \ open_tag ClCompile \
Include=".\\$f" Include="$f"
# Separate file names with Condition? # Separate file names with Condition?
tag_content ObjectFileName "\$(IntDir)$objf" tag_content ObjectFileName "\$(IntDir)$objf"
# Check for AVX and turn it on to avoid warnings. # Check for AVX and turn it on to avoid warnings.
@ -187,7 +197,7 @@ generate_filter() {
close_tag ClCompile close_tag ClCompile
elif [ "$pat" == "h" ] ; then elif [ "$pat" == "h" ] ; then
tag ClInclude \ tag ClInclude \
Include=".\\$f" Include="$f"
elif [ "$pat" == "vcxproj" ] ; then elif [ "$pat" == "vcxproj" ] ; then
open_tag ProjectReference \ open_tag ProjectReference \
Include="$f" Include="$f"
@ -197,7 +207,7 @@ generate_filter() {
close_tag ProjectReference close_tag ProjectReference
else else
tag None \ tag None \
Include=".\\$f" Include="$f"
fi fi
break break
@ -231,7 +241,7 @@ for opt in "$@"; do
;; ;;
--lib) proj_kind="lib" --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 --static-crt) use_static_runtime=true
;; ;;
@ -248,19 +258,23 @@ for opt in "$@"; do
;; ;;
-I*) -I*)
opt="${opt%/}" opt="${opt%/}"
incs="${incs}${incs:+;}${opt##-I}" opt=${opt##-I}
yasmincs="${yasmincs} ${opt}" opt=$(fix_path "$opt")
incs="${incs}${incs:+;}&quot;${opt}&quot;"
yasmincs="${yasmincs} -I${opt}"
;; ;;
-D*) defines="${defines}${defines:+;}${opt##-D}" -D*) defines="${defines}${defines:+;}${opt##-D}"
;; ;;
-L*) # fudge . to $(OutDir) -L*) # fudge . to $(OutDir)
if [ "${opt##-L}" == "." ]; then if [ "${opt##-L}" == "." ]; then
libdirs="${libdirs}${libdirs:+;}\$(OutDir)" libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
else else
# Also try directories for this platform/configuration # Also try directories for this platform/configuration
libdirs="${libdirs}${libdirs:+;}${opt##-L}" opt=${opt##-L}
libdirs="${libdirs}${libdirs:+;}${opt##-L}/\$(PlatformName)/\$(Configuration)" opt=$(fix_path "$opt")
libdirs="${libdirs}${libdirs:+;}${opt##-L}/\$(PlatformName)" libdirs="${libdirs}${libdirs:+;}&quot;${opt}&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)/\$(Configuration)&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)&quot;"
fi fi
;; ;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib" -l*) libs="${libs}${libs:+ }${opt##-l}.lib"
@ -268,7 +282,7 @@ for opt in "$@"; do
-*) die_unknown $opt -*) die_unknown $opt
;; ;;
*) *)
file_list[${#file_list[@]}]="$opt" file_list[${#file_list[@]}]="$(fix_path $opt)"
case "$opt" in case "$opt" in
*.asm|*.s) uses_asm=true *.asm|*.s) uses_asm=true
;; ;;