Skip to content
Snippets Groups Projects
Commit e519a6c5 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Clever setup of variables

parent 5696cafa
No related branches found
No related tags found
1 merge request!42Staging
......@@ -203,6 +203,18 @@ prepare_build_env() {
}
# Appends a value to a variable if that is not already set
# $1: variable name to append the value
# $2: the value to be appended
append_if_not_set() {
if [ -z "${1+abc}" ]; then
eval $1="$2"
elif [[ "${!1}" != "*${2}*" ]]; then
eval $1="${!1} $2"
fi
}
# Checks if an array contains a value
# taken from here: https://stackoverflow.com/questions/3685970/check-if-an-array-contains-a-value
# Parameters: <value-to-check> <array-variable>
......@@ -300,12 +312,12 @@ else
fi
if [ "${OSNAME}" == "macosx" ]; then
CC=gcc
export_env CC
CXX=g++
export_env CXX
MACOSX_DEPLOYMENT_TARGET="10.7"
export_env MACOSX_DEPLOYMENT_TARGET
if [ -n "${CPPFLAGS}" ]; then
CPPFLAGS="${CPPFLAGS} -DBOOST_NO_CXX11_RVALUE_REFERENCES"
else
CPPFLAGS="-DBOOST_NO_CXX11_RVALUE_REFERENCES"
fi
append_if_not_set CPPFLAGS "-DBOOST_NO_CXX11_RVALUE_REFERENCES"
export_env CPPFLAGS
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment