Fix compilation of iOS static libraries.
1. Building for any targets using clang-703.0.31 failed with multiple errors. Using c++11 or c++14 as -std builds successfully. 2. Building for arm64 failed compilation due to duplicate constructors in rapidjson's document.h.pull/923/head
parent
9b6de15b74
commit
867063d8c3
|
@ -557,7 +557,7 @@ public:
|
||||||
flags_ |= kIntFlag;
|
flags_ |= kIntFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(__x86_64__)
|
#if !defined(__x86_64__) && !defined(__arm64__)
|
||||||
//! Constructor for size_t value.
|
//! Constructor for size_t value.
|
||||||
explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) {
|
explicit GenericValue( size_t u ) RAPIDJSON_NOEXCEPT : data_(), flags_( kNumberUintFlag ) {
|
||||||
data_.n.u64 = u;
|
data_.n.u64 = u;
|
||||||
|
|
|
@ -22,6 +22,8 @@ CPP_DEV_TARGET_LIST=(miphoneos-version-min mios-simulator-version-min)
|
||||||
CPP_DEV_TARGET=
|
CPP_DEV_TARGET=
|
||||||
CPP_STD_LIB_LIST=(libc++ libstdc++)
|
CPP_STD_LIB_LIST=(libc++ libstdc++)
|
||||||
CPP_STD_LIB=
|
CPP_STD_LIB=
|
||||||
|
CPP_STD_LIST=(c++03 c++11 c++14)
|
||||||
|
CPP_STD=
|
||||||
|
|
||||||
function join { local IFS="$1"; shift; echo "$*"; }
|
function join { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
|
||||||
|
@ -46,7 +48,7 @@ build_arch()
|
||||||
export CFLAGS="-arch $1 -pipe -no-cpp-precomp -stdlib=$CPP_STD_LIB -isysroot $SDKROOT -$CPP_DEV_TARGET=$IOS_SDK_TARGET -I$SDKROOT/usr/include/"
|
export CFLAGS="-arch $1 -pipe -no-cpp-precomp -stdlib=$CPP_STD_LIB -isysroot $SDKROOT -$CPP_DEV_TARGET=$IOS_SDK_TARGET -I$SDKROOT/usr/include/"
|
||||||
export LDFLAGS="-L$SDKROOT/usr/lib/"
|
export LDFLAGS="-L$SDKROOT/usr/lib/"
|
||||||
export CPPFLAGS=$CFLAGS
|
export CPPFLAGS=$CFLAGS
|
||||||
export CXXFLAGS=$CFLAGS
|
export CXXFLAGS="$CFLAGS -std=$CPP_STD"
|
||||||
|
|
||||||
rm CMakeCache.txt
|
rm CMakeCache.txt
|
||||||
|
|
||||||
|
@ -65,11 +67,16 @@ build_arch()
|
||||||
echo "[!] $0 - assimp iOS build script"
|
echo "[!] $0 - assimp iOS build script"
|
||||||
|
|
||||||
CPP_STD_LIB=${CPP_STD_LIB_LIST[0]}
|
CPP_STD_LIB=${CPP_STD_LIB_LIST[0]}
|
||||||
|
CPP_STD=${CPP_STD_LIST[0]}
|
||||||
DEPLOY_ARCHS=${BUILD_ARCHS_ALL[*]}
|
DEPLOY_ARCHS=${BUILD_ARCHS_ALL[*]}
|
||||||
DEPLOY_FAT=1
|
DEPLOY_FAT=1
|
||||||
|
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
case $i in
|
case $i in
|
||||||
|
-s=*|--std=*)
|
||||||
|
CPP_STD=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
||||||
|
echo "[!] Selecting c++ standard: $CPP_STD"
|
||||||
|
;;
|
||||||
-l=*|--stdlib=*)
|
-l=*|--stdlib=*)
|
||||||
CPP_STD_LIB=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
CPP_STD_LIB=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
|
||||||
echo "[!] Selecting c++ std lib: $CPP_STD_LIB"
|
echo "[!] Selecting c++ std lib: $CPP_STD_LIB"
|
||||||
|
@ -85,7 +92,8 @@ for i in "$@"; do
|
||||||
-h|--help)
|
-h|--help)
|
||||||
echo " - don't build fat library (--no-fat)."
|
echo " - don't build fat library (--no-fat)."
|
||||||
echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')"
|
echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')"
|
||||||
echo " - supported C++ STD libs. (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')"
|
echo " - supported C++ STD libs (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')"
|
||||||
|
echo " - supported C++ standards (--std): $(echo $(join , ${CPP_STD_LIST[*]}) | sed 's/,/, /g')"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in New Issue