diff options
author | Andrew Morrow <acm@mongodb.com> | 2017-02-09 18:18:04 -0500 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2017-02-15 18:40:45 -0500 |
commit | 38c0eb538d0fd390c6cb9ce9ae9894153f6e8ef5 (patch) | |
tree | de472ad7aa7163f977b861525af5a852cf33f6f2 /src/mongo/unittest | |
parent | 34c00f16a8890775c71c63c860e2086c6bb603aa (diff) | |
download | mongo-38c0eb538d0fd390c6cb9ce9ae9894153f6e8ef5.tar.gz |
SERVER-28004 Add build system support for iOS-related Darwin variants
Use a SCons invocation like the following to attach to the correct SDK
and targeting options.
// macOS native build:
> python buildscripts/scons.py CCFLAGS="-isysroot `xcrun --sdk macosx --show-sdk-path` -mmacosx-version-min=10.10" LINKFLAGS="-Wl,-syslibroot,`xcrun --sdk macosx --show-sdk-path` -mmacosx-version-min=10.10" CC=`xcrun -f --sdk macosx clang` CXX=`xcrun -f --sdk macosx clang++`all
// iOS Cross:
> python buildscripts/scons.py CCFLAGS="-arch arm64 -isysroot `xcrun --sdk iphoneos --show-sdk-path` -miphoneos-version-min=10.2" LINKFLAGS="-arch arm64 -Wl,-syslibroot,`xcrun --sdk iphoneos --show-sdk-path` -miphoneos-version-min=10.2" CC=`xcrun -f --sdk iphoneos clang` CXX=`xcrun -f --sdk iphoneos clang++` TARGET_OS=iOS TARGET_ARCH=aarch64 all
// iOS Simulator Cross:
> python buildscripts/scons.py CCFLAGS="-isysroot `xcrun --sdk iphonesimulator --show-sdk-path` -miphoneos-version-min=10.2" LINKFLAGS="-Wl,-syslibroot,`xcrun --sdk iphonesimulator --show-sdk-path` -miphoneos-version-min=10.2" CC=`xcrun -f --sdk iphonesimulator clang` CXX=`xcrun -f --sdk iphonesimulator clang++` TARGET_OS=iOS-sim all
// tvOS Cross:
> python buildscripts/scons.py CCFLAGS="-arch arm64 -isysroot `xcrun --sdk appletvos --show-sdk-path` -mtvos-version-min=10.1" LINKFLAGS="-arch arm64 -Wl,-syslibroot,`xcrun --sdk appletvos --show-sdk-path` -mtvos-version-min=10.1" CC=`xcrun -f --sdk appletvos clang` CXX=`xcrun -f --sdk appletvos clang++` TARGET_OS=tvOS TARGET_ARCH=aarch64 all
// tvOS Simulator Cross:
> python buildscripts/scons.py CCFLAGS="-isysroot `xcrun --sdk appletvsimulator --show-sdk-path` -mtvos-version-min=10.1" LINKFLAGS="-Wl,-syslibroot,`xcrun --sdk appletvsimulator --show-sdk-path` -mtvos-version-min=10.1" CC=`xcrun -f --sdk appletvsimulator clang` CXX=`xcrun -f --sdk appletvsimulator clang++` TARGET_OS=tvOS-sim
To run the resulting binaries under the simulator, boot a particular
target machine with 'xcrun simctl':
> xcrun simctl boot 'Apple TV 1080p'
Find the ID of the instance that was booted:
> xcrun simctl list | grep 'Apple TV 1080p'
And then spawn the intended binary inside the simulator with that ID:
> xcrun simctl spawn CEEC6346-6D21-4092-A091-E5A3862A357F build/opt/mongo/mongod --dbpath=tmp
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/death_test.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/unittest/death_test.cpp b/src/mongo/unittest/death_test.cpp index dbcbdcdd8f5..7c4759611b0 100644 --- a/src/mongo/unittest/death_test.cpp +++ b/src/mongo/unittest/death_test.cpp @@ -37,6 +37,10 @@ #include <unistd.h> #endif +#if defined(__APPLE__) +#include <TargetConditionals.h> +#endif + #include <sstream> #include "mongo/util/assert_util.h" @@ -58,9 +62,12 @@ namespace unittest { DeathTestImpl::DeathTestImpl(std::unique_ptr<Test> test) : _test(std::move(test)) {} void DeathTestImpl::_doTest() { -#ifdef _WIN32 +#if defined(_WIN32) log() << "Skipping death test on Windows"; return; +#elif defined(__APPLE__) && TARGET_OS_TV + log() << "Skipping death test on tvOS"; + return; #else int pipes[2]; checkSyscall(pipe(pipes)); |