Commit ab5bbfb8 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

fix issue for nlohmann json

parent c0e30f01
......@@ -152,6 +152,54 @@ install_pistache_from_git() {
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nlohmann_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install Nlohmann Json ? <y/N> " prompt
OPTION=""
else
prompt='y'
OPTION="-y"
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
if [[ $prompt =~ [yY](es)* ]]
then
GIT_URL=https://github.com/nlohmann/json.git
echo "Install Nlohmann Json from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading Nlohmann"
if [[ $OPTION =~ -[yY](es)* ]]
then
$SUDO rm -rf json
fi
git clone $GIT_URL
git submodule update --init
cd json && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
cd json
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
popd
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
......@@ -283,6 +331,9 @@ check_install_smf_deps() {
install_pistache_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_nlohmann_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
return 0
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment