#! /usr/bin/env bash # file : msvc-common/msvc-rc-common # copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. # Common rc.exe driver that expects the SDKBIN and INCLUDE variables to be set # for the specific MSVC version/configuration. source "$src_dir/msvc-common/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