early-access version 2853
This commit is contained in:
104
externals/vcpkg/scripts/buildsystems/make_wrapper/cl_cpp_wrapper
vendored
Executable file
104
externals/vcpkg/scripts/buildsystems/make_wrapper/cl_cpp_wrapper
vendored
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/bash
|
||||
# cl_cpp_wrapper
|
||||
# Wrapper around MS's cl.exe to make it act more like Unix cpp
|
||||
|
||||
PATH="$PATH:/usr/bin"
|
||||
|
||||
case $MACHTYPE in
|
||||
*-msys)
|
||||
slash="-"
|
||||
;;
|
||||
*)
|
||||
slash="/"
|
||||
;;
|
||||
esac
|
||||
|
||||
# prog specifies the program that should be run cl.exe
|
||||
prog=cl.exe
|
||||
debug=
|
||||
cppopt=("${slash}nologo")
|
||||
cppopt+=("${slash}E")
|
||||
verbose=
|
||||
shared_index=-1
|
||||
|
||||
processargs()
|
||||
{
|
||||
### Run through every option and convert it to the proper MS one
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-D*) optarg= ;;
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
gotparam=1
|
||||
case "$1" in
|
||||
--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--verbose)
|
||||
verbose=1
|
||||
;;
|
||||
-*)
|
||||
# Remaining '-' options are passed to the compiler
|
||||
if test x$optarg != x ; then
|
||||
cppopt+=("${slash}${1:1}=$optarg")
|
||||
else
|
||||
cppopt+=("${slash}${1:1}")
|
||||
fi
|
||||
;;
|
||||
|
||||
/*)
|
||||
# All '/' options are assumed to be for cpp and are passed through
|
||||
cppopt+=("${slash}${1:1}")
|
||||
;;
|
||||
|
||||
*)
|
||||
file=$1
|
||||
#cppopt+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Whitespace in paths is dealt with by setting IFS and using bash arrays
|
||||
|
||||
# processargs $CPP_FLAGS
|
||||
IFS=""
|
||||
processargs $@
|
||||
|
||||
if test x$V = x1 ; then
|
||||
verbose=1
|
||||
fi
|
||||
|
||||
if test -n "$verbose" ; then
|
||||
echo -n "$prog"
|
||||
for opt in "${cppopt[@]}" ; do
|
||||
echo -n " \"$opt\""
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
|
||||
[ $# -ge 1 -a -f "$1" ] && input="$file" || input="-"
|
||||
|
||||
input_file="${file:-/proc/self/fd/0}"
|
||||
if [ "$input_file" == "/proc/self/fd/0" ]; then
|
||||
#echo "STDIN"
|
||||
# CL does not support reading from STDIN so it is wrapped here.
|
||||
tmpout=cpp_wrapper_$RANDOM.h
|
||||
/usr/bin/cp $input_file $tmpout
|
||||
# from https://stackoverflow.com/questions/36313562/how-to-redirect-stdin-to-file-in-bash
|
||||
#exec 3> cppstdtmp.h
|
||||
#while IFS= read -r line; do
|
||||
# printf '%s' "$line"
|
||||
#done
|
||||
#exec 3<&-
|
||||
#echo "$(</dev/stdin)" > cppstdtmp.h
|
||||
exec $prog ${cppopt[@]} $tmpout
|
||||
rm -f $tmpout
|
||||
else
|
||||
#echo "FILE"
|
||||
exec $prog ${cppopt[@]} $input_file
|
||||
fi
|
||||
|
128
externals/vcpkg/scripts/buildsystems/make_wrapper/windres-rc
vendored
Executable file
128
externals/vcpkg/scripts/buildsystems/make_wrapper/windres-rc
vendored
Executable file
@@ -0,0 +1,128 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for windres to rc which do not understand '-i -o --output-format'.
|
||||
# cvtres is invoked by the linker
|
||||
scriptversion=2021-04-02.18; # UTC
|
||||
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_windres_wrapper rc args...
|
||||
# Adjust compile command to suit rc instead of windres
|
||||
func_windres_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
in=
|
||||
out=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
eat=1
|
||||
func_file_conv "$2"
|
||||
out="$file"
|
||||
echo "OUTPUT:$file"
|
||||
set x "$@"
|
||||
shift
|
||||
;;
|
||||
*.obj)
|
||||
func_file_conv "$1"
|
||||
out="$file"
|
||||
echo "OUTPUT:$file"
|
||||
set x "$@"
|
||||
shift
|
||||
;;
|
||||
--output-format=*)
|
||||
set x "$@"
|
||||
shift
|
||||
;;
|
||||
-i)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
in="$file"
|
||||
echo "INPUT:$file"
|
||||
set x "$@"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "${1//\\\"/\"}"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
echo "$@" -fo "$out" "$in"
|
||||
exec "$@" -fo "$out" "$in"
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
func_windres_wrapper "$@"
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
Reference in New Issue
Block a user