[Fix] `nvm install -s`: properly precompute clang version

J Huang 2017-06-13 13:06:53 +08:00 committed by Jordan Harband
parent 7965796569
commit 28fe93cd15
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -1895,7 +1895,7 @@ nvm_install_source() {
make='gmake'
;;
esac
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to nvm_clang_version 3.5; then
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to "$(nvm_clang_version)" 3.5; then
if [ -z "${CC-}" ] || [ -z "${CXX-}" ] ; then
nvm_echo "Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!"
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"