diff --git a/mac_build/BuildMacBOINC.sh b/mac_build/BuildMacBOINC.sh index 175248e3c4..e65b60bb1b 100644 --- a/mac_build/BuildMacBOINC.sh +++ b/mac_build/BuildMacBOINC.sh @@ -27,6 +27,7 @@ # Updated 7/9/12 for Xcode 4.3 and later which are not at a fixed address # Updated 2/7/14 to also build libboinc_zip.a # Updated 11/28/15 to build ScreenSaver with ARC under Xcode 6 or later +# Updated 2/3/16 to allow optional use of libc++ and C++11 dialect # ## This script requires OS 10.8 or later # @@ -52,6 +53,10 @@ ## -noclean don't do a "clean" of each target before building. ## default is to clean all first. ## +## -libc++ build using libc++ instead of libstdc++ (requires OS 10.7) +## +## -c++11 build using c++11 language dialect instead of default (requires libc++) +## ## The following arguments determine which targets to build ## ## -all build all targets (i.e. target "Build_All" -- this is the default) @@ -68,6 +73,8 @@ targets="" doclean="clean" +cplusplus11dialect="" +uselibcplusplus="" buildall=0 buildlibs=0 buildclient=0 @@ -85,6 +92,8 @@ while [ $# -gt 0 ]; do case "$1" in -noclean ) doclean="" ; shift 1 ;; -dev ) style="Development" ; shift 1 ;; + -libc++ ) uselibcplusplus="CLANG_CXX_LIBRARY=libc++ MACOSX_DEPLOYMENT_TARGET=10.7" ; shift 1 ;; + -c++11 ) cplusplus11dialect="CLANG_CXX_LANGUAGE_STANDARD=c++11" ; shift 1 ;; -all ) buildall=1 ; shift 1 ;; -lib ) buildlibs=1 ; shift 1 ;; -client ) buildclient=1 ; shift 1 ;; @@ -151,28 +160,28 @@ SDKPATH=`xcodebuild -version -sdk macosx Path` if [ $isXcode6orLater = 0 ]; then ## echo "Xcode version < 6" ## Build the screensaver using our standard settings (with Garbage Collection) - xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} -sdk "${SDKPATH}" ${doclean} build + xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} -sdk "${SDKPATH}" ${doclean} build ${uselibcplusplus} ${cplusplus11dialect} else ## echo "Xcode version > 5" ## We must modify the build settings for the screensaver only, to build it with ARC - xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} -sdk "${SDKPATH}" ${doclean} build + xcodebuild -project boinc.xcodeproj ${targets} -configuration ${style} -sdk "${SDKPATH}" ${doclean} build ${uselibcplusplus} ${cplusplus11dialect} result=$? - if [ $result -eq 0 ]; then - xcodebuild -project boinc.xcodeproj -target ScreenSaver -configuration ${style} -sdk "${SDKPATH}" ${doclean} build ARCHS=x86_64 GCC_ENABLE_OBJC_GC=unsupported + if [ "${buildall}" = "1" ] || [ "${targets}" = "" ]; then + if [ $result -eq 0 ]; then + xcodebuild -project boinc.xcodeproj -target ScreenSaver -configuration ${style} -sdk "${SDKPATH}" ${doclean} build ARCHS=x86_64 GCC_ENABLE_OBJC_GC=unsupported ${uselibcplusplus} ${cplusplus11dialect} + fi fi fi - - result=$? if [ $result -eq 0 ]; then # build ibboinc_zip.a for -all or -lib or default, where # default is none of { -all, -lib, -client } if [ "${buildall}" = "1" ] || [ "${buildlibs}" = "1" ] || [ "${buildclient}" = "0" ]; then - xcodebuild -project ../zip/boinc_zip.xcodeproj -target boinc_zip -configuration ${style} -sdk "${SDKPATH}" ${doclean} build + xcodebuild -project ../zip/boinc_zip.xcodeproj -target boinc_zip -configuration ${style} -sdk "${SDKPATH}" ${doclean} build ${uselibcplusplus} ${cplusplus11dialect} result=$? fi