From 7b14ea616eb9a6dab348a06f8b2d6c915ffd3a96 Mon Sep 17 00:00:00 2001 From: mmathias01 Date: Thu, 24 Nov 2011 11:58:24 +0000 Subject: [PATCH] Update iOS README.txt, improve iOS build script and toolchain files. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1090 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake | 2 +- port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake | 2 +- port/iOS/README.txt | 14 +++++++++++++- port/iOS/build_ios.sh | 25 +++++++++++++++---------- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake index 3a360736b..0d443b798 100644 --- a/port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake @@ -2,7 +2,7 @@ INCLUDE(CMakeForceCompiler) SET (CMAKE_CROSSCOMPILING TRUE) SET (CMAKE_SYSTEM_NAME "Darwin") -SET (CMAKE_SYSTEM_PROCESSOR "arm6") +SET (CMAKE_SYSTEM_PROCESSOR "armv6") SET (SDKVER "5.0") SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer") diff --git a/port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake index 699c155f2..211ee71d4 100644 --- a/port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake @@ -2,7 +2,7 @@ INCLUDE(CMakeForceCompiler) SET (CMAKE_CROSSCOMPILING TRUE) SET (CMAKE_SYSTEM_NAME "Darwin") -SET (CMAKE_SYSTEM_PROCESSOR "arm7") +SET (CMAKE_SYSTEM_PROCESSOR "armv7") SET (SDKVER "5.0") SET (DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer") diff --git a/port/iOS/README.txt b/port/iOS/README.txt index 3d2973b04..ce13faa05 100644 --- a/port/iOS/README.txt +++ b/port/iOS/README.txt @@ -1 +1,13 @@ -This folder will contain the iOS build scripts to enable AssImp to be compiled for arm6/7 and i386 as a static library (.a) file for iOS \ No newline at end of file +To build for iOS simply execute "./build_ios.sh" from this folder. Currently this script requires the latest SDK (5.0) from Apple in order to build properly. In the future I will add support for specifying the SDK version on the command line. + +Once the build is completed you will see a "ios" folder under /lib. This folder has sub folders for each of the following architectures: + +* armv6 (Older Devices) +* armv7 (New Devices) +* i386 (Simulator) + +Each of these folders contains a single static library for that architecture. In addition the libassimp.a file in the root of this folder is a combined archive (fat binary) library for all of the above architectures. + +This port is being maintained by Matt Mathias please contact him with any questions or comments. + + diff --git a/port/iOS/build_ios.sh b/port/iOS/build_ios.sh index ac2d3a8de..9c8cc363a 100755 --- a/port/iOS/build_ios.sh +++ b/port/iOS/build_ios.sh @@ -5,7 +5,6 @@ # BUILD ASSIMP for iOS and iOS Simulator ####################### -PKG_NAME=bullet-2.78 BUILD_DIR="./lib/ios" IOS_BASE_SDK="5.0" @@ -69,28 +68,34 @@ create_outdir() lib_arm6=`echo $lib_i386 | sed "s/i386/arm6/g"` lib_arm7=`echo $lib_i386 | sed "s/i386/arm7/g"` lib=`echo $lib_i386 | sed "s/i386\///g"` + echo 'Creating fat binary...' lipo -arch armv6 $lib_arm6 -arch armv7 $lib_arm7 -arch i386 $lib_i386 -create -output $lib done + echo 'Done! You will find the libaries and fat binary library in /lib/ios' } cd ../../ rm -rf $BUILD_DIR mkdir -p $BUILD_DIR/arm6 $BUILD_DIR/arm7 $BUILD_DIR/i386 -make clean 2> /dev/null setenv_arm6 -make assimp -j8 -cp ./lib/libassimp.a $BUILD_DIR/arm6 +echo 'Building armv6 library' +make clean +make assimp -j 8 -l +cp ./lib/libassimp.a $BUILD_DIR/arm6/ -make clean 2> /dev/null setenv_arm7 -make assimp -j8 -cp ./lib/libassimp.a $BUILD_DIR/arm7 +echo 'Building armv7 library' +make clean +make assimp -j 8 -l +cp ./lib/libassimp.a $BUILD_DIR/arm7/ + -make clean 2> /dev/null setenv_i386 -make assimp -j8 -cp ./lib/libassimp.a $BUILD_DIR/i386 +echo 'Building i386 library' +make clean +make assimp -j 8 -l +cp ./lib/libassimp.a $BUILD_DIR/i386/ rm ./lib/libassimp.a