Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tune CC and CXX assignment #1336

Merged
merged 1 commit into from
Dec 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1853,15 +1853,24 @@ nvm_install_source() {

local make
make='make'
if [ "${NVM_OS}" = 'freebsd' ]; then
make='gmake'
MAKE_CXX='CXX=c++'
elif [ "${NVM_OS}" = 'aix' ]; then
make='gmake'
fi
if nvm_has "clang++" && nvm_has "clang" && nvm_version_greater_than_or_equal_to nvm_clang_version 3.5 ; then
nvm_echo "Clang v3.5+ detected! Use Clang as c/c++ compiler!"
MAKE_CXX='CC=clang CXX=clang++'
local MAKE_CXX
case "${NVM_OS}" in
'freebsd')
make='gmake'
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this seems like an oversight - there's no local MAKE_CXX declaration in this function. let's add one above the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

;;
'darwin')
MAKE_CXX="CC=${CC:-cc} CXX=${CXX:-c++}"
;;
'aix')
make='gmake'
;;
esac
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++}"
fi
fi

local tar_compression_flag
Expand Down