aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-02-13 00:15:46 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-02-13 00:15:46 +0300
commite4b3ac29cff3674175f072cea6222b67b0bd5e0b (patch)
tree6e8b7c82b93e6163cb3a0172ffd72baa6072c1ad /%HOME%/.bash_utils
parentexport BASHOPTS (diff)
downloadlinux-home-e4b3ac29cff3674175f072cea6222b67b0bd5e0b.tar.gz
linux-home-e4b3ac29cff3674175f072cea6222b67b0bd5e0b.zip
runc*: customizable compiler selection
Diffstat (limited to '%HOME%/.bash_utils')
-rw-r--r--%HOME%/.bash_utils/cxx.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/%HOME%/.bash_utils/cxx.sh b/%HOME%/.bash_utils/cxx.sh
index 7fb9714..db006d2 100644
--- a/%HOME%/.bash_utils/cxx.sh
+++ b/%HOME%/.bash_utils/cxx.sh
@@ -6,6 +6,10 @@
# Distributed under the MIT License.
runc_flags=('-Wall' '-Wextra')
+runcxx_flags=('-Wall' '-Wextra' '-std=c++14')
+
+runc_compiler=gcc
+runcxx_compiler=g++
_runc_usage() (
set -o errexit -o nounset -o pipefail
@@ -78,15 +82,13 @@ runc() (
local output_name
output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX.exe" )"
- gcc -o "$output_name" \
+ "${runc_compiler:-gcc}" -o "$output_name" \
${c_flags[@]+"${c_flags[@]}"} \
${src_files[@]+"${src_files[@]}"}
"$output_name" ${prog_args[@]+"${prog_args[@]}"}
)
-runcxx_flags=('-Wall' '-Wextra' '-std=c++14')
-
_runcxx_usage() (
set -o errexit -o nounset -o pipefail
@@ -158,7 +160,7 @@ runcxx() (
local output_name
output_name="$( mktemp --tmpdir=. -- "${FUNCNAME[0]}XXX.exe" )"
- g++ -o "$output_name" \
+ "${runcxx_compiler:-g++}" -o "$output_name" \
${cxx_flags[@]+"${cxx_flags[@]}"} \
${src_files[@]+"${src_files[@]}"}