diff options
author | James Zern <jzern@google.com> | 2014-04-22 23:03:19 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2014-04-23 12:47:32 -0700 |
commit | 792509d31f147ba6831dd779e62d3ac5d4a28be1 (patch) | |
tree | 4349d737211ec70abd689f7c16e5065d8304497d /build/make/gen_msvs_vcxproj.sh | |
parent | a757a99c8e6fb54b41996f506b07d39c6062105b (diff) | |
download | libvpx-792509d31f147ba6831dd779e62d3ac5d4a28be1.tar libvpx-792509d31f147ba6831dd779e62d3ac5d4a28be1.tar.gz libvpx-792509d31f147ba6831dd779e62d3ac5d4a28be1.tar.bz2 libvpx-792509d31f147ba6831dd779e62d3ac5d4a28be1.zip |
gen_msvs_vcxproj.sh: support cygwin style paths
Change-Id: I2f05a5d90b3ad6250d31f7b422af4c22527177d1
Diffstat (limited to 'build/make/gen_msvs_vcxproj.sh')
-rwxr-xr-x | build/make/gen_msvs_vcxproj.sh | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/build/make/gen_msvs_vcxproj.sh b/build/make/gen_msvs_vcxproj.sh index 23990a413..a64e129b2 100755 --- a/build/make/gen_msvs_vcxproj.sh +++ b/build/make/gen_msvs_vcxproj.sh @@ -14,6 +14,12 @@ self=$0 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 @@ -55,6 +61,10 @@ die_unknown(){ exit 1 } +fix_path() { + $FIXPATH "$1" +} + generate_uuid() { local hex="0123456789ABCDEF" local i @@ -154,7 +164,7 @@ generate_filter() { if [ "${f##*.}" == "$pat" ]; then 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 # Avoid object file name collisions, i.e. vpx_config.c and @@ -162,7 +172,7 @@ generate_filter() { # this additional suffix. objf=${objf%.obj}_asm.obj open_tag CustomBuild \ - Include=".\\$f" + Include="$f" for plat in "${platforms[@]}"; do for cfg in Debug Release; do tag_content Message "Assembling %(Filename)%(Extension)" \ @@ -177,7 +187,7 @@ generate_filter() { elif [ "$pat" == "c" ] || \ [ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then open_tag ClCompile \ - Include=".\\$f" + Include="$f" # Separate file names with Condition? tag_content ObjectFileName "\$(IntDir)$objf" # Check for AVX and turn it on to avoid warnings. @@ -187,7 +197,7 @@ generate_filter() { close_tag ClCompile elif [ "$pat" == "h" ] ; then tag ClInclude \ - Include=".\\$f" + Include="$f" elif [ "$pat" == "vcxproj" ] ; then open_tag ProjectReference \ Include="$f" @@ -197,7 +207,7 @@ generate_filter() { close_tag ProjectReference else tag None \ - Include=".\\$f" + Include="$f" fi break @@ -231,7 +241,7 @@ for opt in "$@"; do ;; --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 ;; @@ -248,19 +258,23 @@ for opt in "$@"; do ;; -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}" ;; -L*) # fudge . to $(OutDir) if [ "${opt##-L}" == "." ]; then - libdirs="${libdirs}${libdirs:+;}\$(OutDir)" + libdirs="${libdirs}${libdirs:+;}"\$(OutDir)"" else # Also try directories for this platform/configuration - libdirs="${libdirs}${libdirs:+;}${opt##-L}" - libdirs="${libdirs}${libdirs:+;}${opt##-L}/\$(PlatformName)/\$(Configuration)" - libdirs="${libdirs}${libdirs:+;}${opt##-L}/\$(PlatformName)" + opt=${opt##-L} + opt=$(fix_path "$opt") + libdirs="${libdirs}${libdirs:+;}"${opt}"" + libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)/\$(Configuration)"" + libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)"" fi ;; -l*) libs="${libs}${libs:+ }${opt##-l}.lib" @@ -268,7 +282,7 @@ for opt in "$@"; do -*) die_unknown $opt ;; *) - file_list[${#file_list[@]}]="$opt" + file_list[${#file_list[@]}]="$(fix_path $opt)" case "$opt" in *.asm|*.s) uses_asm=true ;; |