aboutsummaryrefslogtreecommitdiff
path: root/msvc-rc-common
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-24 11:38:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-24 11:38:44 +0200
commit3209a9fa6e87ad4d2f9d1087a1206347df4c6214 (patch)
tree84646641225fba708abb5733ce175ceb904a0de0 /msvc-rc-common
parentd929add3baa3fac5720cf4053c42bb846d83c66b (diff)
Reorganize the script structure
Diffstat (limited to 'msvc-rc-common')
-rwxr-xr-xmsvc-rc-common121
1 files changed, 0 insertions, 121 deletions
diff --git a/msvc-rc-common b/msvc-rc-common
deleted file mode 100755
index 17c9333..0000000
--- a/msvc-rc-common
+++ /dev/null
@@ -1,121 +0,0 @@
-#! /usr/bin/env bash
-
-# Common rc.exe driver that expects the SDKBIN and INCLUDE variables to be set
-# for the specific MSVC version/configuration.
-
-trap "{ exit 1; }" ERR
-set -o errtrace # Trap in functions.
-
-function info () { echo "$*" 1>&2; }
-function error () { info "$*"; exit 1; }
-
-source $(dirname $(realpath ${BASH_SOURCE[0]}))/msvc-common
-
-# Translate absolute paths from POSIX to Windows. Use bash array to store
-# arguments in case they contain spaces.
-#
-# This needs to be done for both certain option values and arguments.
-# Arguments are tricky in that unless we recognize every option, and option
-# may look a lot like an absolute POSIX path (e.g., /nologo). The heuristics
-# that we are going to use here is that if the argument starts with / and
-# contains at least one more /, then we consider it an argument. Otherwise --
-# an options. We will also explicitly recognize certain options which may not
-# fit this scheme well.
-#
-# Note that the order of the cases is important. Specifically, we want, e.g.,
-# /D before /D*.
-#
-# Note that rc.exe /? is missing some options that are documented in MSDN.
-#
-args=()
-
-while [ $# -gt 0 ]; do
- case ${1^^} in # Uppercase for case-insensitive comparison.
-
- # /I <dir>
- #
- [/-]I)
- args=("${args[@]}" "$1")
- shift
- args=("${args[@]}" "$(translate $1)")
- shift
- ;;
-
- # /I<dir>
- #
- [/-]I*)
- args=("${args[@]}" "$(split_translate 2 $1)")
- shift
- ;;
-
- # /f[om] <file>
- #
- [/-]F[OM])
- args=("${args[@]}" "$1")
- shift
- args=("${args[@]}" "$(translate $1)")
- shift
- ;;
-
- # /f[om]<file>
- #
- [/-]F[OM]*)
- args=("${args[@]}" "$(split_translate 3 $1)")
- shift
- ;;
-
- # /q <file>
- #
- [/-]Q)
- args=("${args[@]}" "$1")
- shift
- args=("${args[@]}" "$(translate $1)")
- shift
- ;;
-
- # /q<file>
- #
- [/-]Q*)
- args=("${args[@]}" "$(split_translate 2 $1)")
- shift
- ;;
-
- # Handle other options with separate values. This makes sure we don't try
- # to path-translate them.
- #
- [/-]D | \
- [/-]U)
- args=("${args[@]}" "$1")
- shift
- args=("${args[@]}" "$1")
- shift
- ;;
-
- # Handle other options with combined values that could possibly be
- # interpreted as paths, for example /DFOO=foo/bar.
- #
- [/-]D*)
- args=("${args[@]}" "$1")
- shift
- ;;
-
- # Option or argument.
- #
- *)
- # If contains at least two slashes, treat it as a path.
- #
- if [[ "$1" == /*/* ]]; then
- args=("${args[@]}" "$(translate $1)")
- else
- args=("${args[@]}" "$1")
- fi
- shift
- ;;
- esac
-done
-
-export INCLUDE
-
-# rc.exe always sends diagnostics to stdout.
-#
-msvc_exec 1 "$SDKBIN\\rc.exe" "${args[@]}"