diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-10-16 16:12:54 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-10-16 16:39:49 +0300 |
commit | 795dcf9da430c55f2702793b80ce031bf11933db (patch) | |
tree | 98798cbee2339794283699f181eb65ff906cc04f | |
parent | 687275db4c13daf5d31123ac65517e07172278ee (diff) |
Make libc++ optional for iOS and use the right library in the Xcode projects
It seems that using libc++ when building with Xcode 4 (and iOS SDK 6)
you get linking errors. Stick to libstdc++ for now then with that.
Propagate the choice to the iOS Xcode projects through the lo.xcconfig
file.
Change-Id: Ic61dd2336066a77c4219c532106e3e50e85d0689
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | ios/MobileLibreOffice/MobileLibreOffice.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | ios/lo.xcconfig.in | 5 | ||||
-rw-r--r-- | ios/shared/ios_sharedlo.xcodeproj/project.pbxproj | 4 |
4 files changed, 28 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 51a971604cd1..ca581e375190 100644 --- a/configure.ac +++ b/configure.ac @@ -2911,6 +2911,7 @@ if test $_os = iOS; then for sdkver in 7.0 6.1 6.0; do t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk if test -d $t; then + ios_sdk=$sdkver sysroot=$t break fi @@ -2956,9 +2957,27 @@ if test $_os = iOS; then # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also # get compiled with it, to avoid ld warnings when linking all that together into one # executable. - # Also, use libc++. + # Use libc++ if opted in only, and only when building against iOS 7 SDK or newer. + + XCODE_CLANG_CXX_LIBRARY=libstdc++ + case $ios_sdk in + 6.*) + if test "$enable_libc__" = yes; then + AC_MSG_ERROR([--enable-libc++ requires using Xcode 5 and iOS SDK 7 or newer it seems]) + fi + ;; + *) + if test "$enable_libc__" = yes; then + XCODE_CLANG_CXX_LIBRARY=libc++ + fi + ;; + esac + + stdlib="-stdlib=$XCODE_CLANG_CXX_LIBRARY" + CC="`xcrun -find clang` -arch $arch -fvisibility=hidden -isysroot $sysroot $lto $versionmin" - CXX="`xcrun -find clang++` -arch $arch -fvisibility=hidden -stdlib=libc++ -isysroot $sysroot $lto $versionmin" + CXX="`xcrun -find clang++` -arch $arch -fvisibility=hidden $stdlib -isysroot $sysroot $lto $versionmin" + INSTALL_NAME_TOOL=`xcrun -find install_name_tool` AR=`xcrun -find ar` NM=`xcrun -find nm` @@ -2967,6 +2986,8 @@ if test $_os = iOS; then RANLIB=`xcrun -find ranlib` fi +AC_SUBST(XCODE_CLANG_CXX_LIBRARY) + AC_MSG_CHECKING([whether to treat the installation as read-only]) if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \ diff --git a/ios/MobileLibreOffice/MobileLibreOffice.xcodeproj/project.pbxproj b/ios/MobileLibreOffice/MobileLibreOffice.xcodeproj/project.pbxproj index f1a3b42028bf..220ce0099697 100644 --- a/ios/MobileLibreOffice/MobileLibreOffice.xcodeproj/project.pbxproj +++ b/ios/MobileLibreOffice/MobileLibreOffice.xcodeproj/project.pbxproj @@ -1510,7 +1510,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = armv7; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1555,7 +1554,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = armv7; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -1592,7 +1590,6 @@ 689EBB0E18069FB8002F1CD7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LIBRARY = "libc++"; GCC_DYNAMIC_NO_PIC = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -1614,7 +1611,6 @@ 689EBB0F18069FB8002F1CD7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LIBRARY = "libc++"; GCC_DYNAMIC_NO_PIC = NO; GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/ios/lo.xcconfig.in b/ios/lo.xcconfig.in index 4121cbca94a4..7a375455a383 100644 --- a/ios/lo.xcconfig.in +++ b/ios/lo.xcconfig.in @@ -16,3 +16,8 @@ LO_BUILDDIR = @BUILDDIR@ LO_INSTDIR = @INSTDIR@ LO_OUTDIR = @OUTDIR@ LO_WORKDIR = @WORKDIR@ + +// These are actual Xcode-known settings. The corresponding autoconf +// variables are prefixed with XCODE_ to make it clear in configure.ac +// what they will be used for. +CLANG_CXX_LIBRARY = @XCODE_CLANG_CXX_LIBRARY@ diff --git a/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj b/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj index fc9aa39b0256..87661880fbe3 100644 --- a/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj +++ b/ios/shared/ios_sharedlo.xcodeproj/project.pbxproj @@ -459,7 +459,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = armv7; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -500,7 +499,6 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = armv7; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -531,7 +529,6 @@ 68FDBE3918053A140064DD74 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LIBRARY = "libc++"; DSTROOT = /tmp/ios_sharedlo.dst; GCC_DYNAMIC_NO_PIC = NO; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; @@ -549,7 +546,6 @@ 68FDBE3A18053A140064DD74 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_CXX_LIBRARY = "libc++"; DSTROOT = /tmp/ios_sharedlo.dst; GCC_DYNAMIC_NO_PIC = NO; GCC_LINK_WITH_DYNAMIC_LIBRARIES = NO; |