diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-02-23 20:19:48 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-02-23 20:19:48 +0300 |
commit | 536d4335885b35a556fc1d06380b9415bb782f0e (patch) | |
tree | 80e4114b1240da8a9bc3f9f233d672b90cd87c65 | |
parent | runc*: no .exe extensions (diff) | |
download | linux-home-536d4335885b35a556fc1d06380b9415bb782f0e.tar.gz linux-home-536d4335885b35a556fc1d06380b9415bb782f0e.zip |
runc*: add .exe on Cygwin
Diffstat (limited to '')
-rw-r--r-- | %HOME%/.bash_utils/cxx.sh | 15 |
1 files changed, 13 insertions, 2 deletions
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[@]}"} \ |