From 66ce9030d2d2a100593b90b1d0e2188001db2d3e Mon Sep 17 00:00:00 2001 From: Cal Peyser Date: Wed, 11 May 2016 09:31:47 +0000 Subject: Reconcile cc and objc default compiler flags in the crosstool. -- MOS_MIGRATED_REVID=122035585 --- .../devtools/build/lib/rules/objc/CompilationSupport.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java index 27dc24bdb9..6abcce77b3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java @@ -130,6 +130,13 @@ public final class CompilationSupport { static final ImmutableList CLANG_COVERAGE_FLAGS = ImmutableList.of("-fprofile-arcs", "-ftest-coverage"); + // These are added by Xcode when building, because the simulator is built on OSX + // frameworks so we aim compile to match the OSX objc runtime. + @VisibleForTesting + static final ImmutableList IOS_SIMULATOR_COMPILE_FLAGS = + ImmutableList.of( + "-fexceptions", "-fasm-blocks", "-fobjc-abi-version=2", "-fobjc-legacy-dispatch"); + /** * Returns the location of the xcrunwrapper tool. */ @@ -1511,13 +1518,7 @@ public final class CompilationSupport { case IOS_DEVICE: return ImmutableList.of(); case IOS_SIMULATOR: - // These are added by Xcode when building, because the simulator is built on OSX - // frameworks so we aim compile to match the OSX objc runtime. - return ImmutableList.of( - "-fexceptions", - "-fasm-blocks", - "-fobjc-abi-version=2", - "-fobjc-legacy-dispatch"); + return IOS_SIMULATOR_COMPILE_FLAGS; default: throw new AssertionError(); } -- cgit v1.2.3