aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-02-23 20:19:48 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-02-23 20:19:48 +0300
commit536d4335885b35a556fc1d06380b9415bb782f0e (patch)
tree80e4114b1240da8a9bc3f9f233d672b90cd87c65 /%HOME%/.bash_utils
parentrunc*: no .exe extensions (diff)
downloadlinux-home-536d4335885b35a556fc1d06380b9415bb782f0e.tar.gz
linux-home-536d4335885b35a556fc1d06380b9415bb782f0e.zip
runc*: add .exe on Cygwin
Diffstat (limited to '%HOME%/.bash_utils')
-rw-r--r--%HOME%/.bash_utils/cxx.sh15
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[@]}"} \