From e4b3ac29cff3674175f072cea6222b67b0bd5e0b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 13 Feb 2017 00:15:46 +0300 Subject: runc*: customizable compiler selection --- %HOME%/.bash_utils/cxx.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to '%HOME%') 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[@]}"} -- cgit v1.2.3