diff --git a/Nimble.podspec b/Nimble.podspec index 800bf72c8..727ec4fc4 100644 --- a/Nimble.podspec +++ b/Nimble.podspec @@ -34,9 +34,10 @@ Pod::Spec.new do |s| 'OTHER_SWIFT_FLAGS' => '$(inherited) -suppress-warnings', } - - s.dependency 'CwlPreconditionTesting', '~> 2.1.0' - s.dependency 'CwlCatchException', '~> 2.1.0' + [s.osx, s.ios].each do |platform| + platform.dependency 'CwlMachBadInstructionHandler', '~> 2.1.0' + platform.dependency 'CwlCatchException', '~> 2.1.0' + end s.cocoapods_version = '>= 1.4.0' if s.respond_to?(:swift_versions) then diff --git a/Sources/Nimble/Matchers/ThrowAssertion.swift b/Sources/Nimble/Matchers/ThrowAssertion.swift index b64a06211..e26c7267e 100644 --- a/Sources/Nimble/Matchers/ThrowAssertion.swift +++ b/Sources/Nimble/Matchers/ThrowAssertion.swift @@ -83,7 +83,7 @@ public func catchBadInstruction(block: @escaping () -> Void) -> BadInstructionEx public func throwAssertion() -> Matcher { return Matcher { actualExpression in - #if (arch(x86_64) || arch(arm64)) && (canImport(Darwin) || canImport(Glibc)) + #if (arch(x86_64) || arch(arm64)) && (canImport(CwlPreconditionTesting) || canImport(CwlPosixPreconditionTesting) || canImport(Glibc)) let message = ExpectationMessage.expectedTo("throw an assertion") var actualError: Error? let caughtException: BadInstructionException? = catchBadInstruction { diff --git a/Sources/Nimble/Nimble.h b/Sources/Nimble/Nimble.h index eab5ea131..32d349845 100644 --- a/Sources/Nimble/Nimble.h +++ b/Sources/Nimble/Nimble.h @@ -4,8 +4,8 @@ #import #if TARGET_OS_OSX || TARGET_OS_IOS - #import - #import + #import "CwlMachBadInstructionHandler.h" + #import "CwlCatchException.h" #endif FOUNDATION_EXPORT double NimbleVersionNumber;