From 536d4335885b35a556fc1d06380b9415bb782f0e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 23 Feb 2017 20:19:48 +0300 Subject: runc*: add .exe on Cygwin --- %HOME%/.bash_utils/cxx.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to '%HOME%/.bash_utils') diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh index 1cd3f3e..4e332e7 100644 --- a/%HOME%/.bash_utils/cxx.sh +++ b/%HOME%/.bash_utils/cxx.sh @@ -5,6 +5,17 @@ # For details, see https://github.com/egor-tensin/cygwin-home. # Distributed under the MIT License. +_runc_is_cygwin() ( + set -o errexit -o nounset -o pipefail + local os + os="$( uname -o )" + test 'Cygwin' = "$os" +) + +if _runc_is_cygwin; then + _runc_exe_ext='.exe' +fi + runc_flags=('-Wall' '-Wextra') runcxx_flags=('-Wall' '-Wextra' '-std=c++14') @@ -80,7 +91,7 @@ runc() ( pushd "$build_dir" > /dev/null local output_name - output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX" )" + output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX${_runc_exe_ext-}" )" "${runc_compiler:-gcc}" -o "$output_name" \ ${c_flags[@]+"${c_flags[@]}"} \ @@ -158,7 +169,7 @@ runcxx() ( pushd "$build_dir" > /dev/null local output_name - output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX" )" + output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX${_runc_exe_ext-}" )" "${runcxx_compiler:-g++}" -o "$output_name" \ ${cxx_flags[@]+"${cxx_flags[@]}"} \ -- cgit v1.2.3