chromium/third_party/ocmock/BUILD.gn

# Copyright 2015 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

assert(is_apple)

config("ocmock_config") {
  include_dirs = [ "//third_party/ocmock" ]
}

source_set("ocmock") {
  testonly = true

  sources = [
    # Helper for using with gtest.
    "gtest_support.h",
    "gtest_support.mm",

    # Some extra features to make using OCMock easier.
    "ocmock_extensions.h",
    "ocmock_extensions.mm",

    # OCMock sources.
    "OCMock/NSInvocation+OCMAdditions.h",
    "OCMock/NSInvocation+OCMAdditions.m",
    "OCMock/NSMethodSignature+OCMAdditions.h",
    "OCMock/NSMethodSignature+OCMAdditions.m",
    "OCMock/NSNotificationCenter+OCMAdditions.h",
    "OCMock/NSNotificationCenter+OCMAdditions.m",
    "OCMock/NSObject+OCMAdditions.h",
    "OCMock/NSObject+OCMAdditions.m",
    "OCMock/NSValue+OCMAdditions.h",
    "OCMock/NSValue+OCMAdditions.m",
    "OCMock/OCClassMockObject.h",
    "OCMock/OCClassMockObject.m",
    "OCMock/OCMArg.h",
    "OCMock/OCMArg.m",
    "OCMock/OCMArgAction.h",
    "OCMock/OCMArgAction.m",
    "OCMock/OCMBlockArgCaller.h",
    "OCMock/OCMBlockArgCaller.m",
    "OCMock/OCMBlockCaller.h",
    "OCMock/OCMBlockCaller.m",
    "OCMock/OCMBoxedReturnValueProvider.h",
    "OCMock/OCMBoxedReturnValueProvider.m",
    "OCMock/OCMConstraint.h",
    "OCMock/OCMConstraint.m",
    "OCMock/OCMExceptionReturnValueProvider.h",
    "OCMock/OCMExceptionReturnValueProvider.m",
    "OCMock/OCMExpectationRecorder.h",
    "OCMock/OCMExpectationRecorder.m",
    "OCMock/OCMFunctions.h",
    "OCMock/OCMFunctions.m",
    "OCMock/OCMFunctionsPrivate.h",
    "OCMock/OCMIndirectReturnValueProvider.h",
    "OCMock/OCMIndirectReturnValueProvider.m",
    "OCMock/OCMInvocationExpectation.h",
    "OCMock/OCMInvocationExpectation.m",
    "OCMock/OCMInvocationMatcher.h",
    "OCMock/OCMInvocationMatcher.m",
    "OCMock/OCMInvocationStub.h",
    "OCMock/OCMInvocationStub.m",
    "OCMock/OCMLocation.h",
    "OCMock/OCMLocation.m",
    "OCMock/OCMMacroState.h",
    "OCMock/OCMMacroState.m",
    "OCMock/OCMNonRetainingObjectReturnValueProvider.h",
    "OCMock/OCMNonRetainingObjectReturnValueProvider.m",
    "OCMock/OCMNotificationPoster.h",
    "OCMock/OCMNotificationPoster.m",
    "OCMock/OCMObjectReturnValueProvider.h",
    "OCMock/OCMObjectReturnValueProvider.m",
    "OCMock/OCMObserverRecorder.h",
    "OCMock/OCMObserverRecorder.m",
    "OCMock/OCMPassByRefSetter.h",
    "OCMock/OCMPassByRefSetter.m",
    "OCMock/OCMQuantifier.h",
    "OCMock/OCMQuantifier.m",
    "OCMock/OCMRealObjectForwarder.h",
    "OCMock/OCMRealObjectForwarder.m",
    "OCMock/OCMRecorder.h",
    "OCMock/OCMRecorder.m",
    "OCMock/OCMReturnValueProvider.h",
    "OCMock/OCMReturnValueProvider.m",
    "OCMock/OCMStubRecorder.h",
    "OCMock/OCMStubRecorder.m",
    "OCMock/OCMVerifier.h",
    "OCMock/OCMVerifier.m",
    "OCMock/OCMock.h",
    "OCMock/OCMockMacros.h",
    "OCMock/OCMockObject.h",
    "OCMock/OCMockObject.m",
    "OCMock/OCObserverMockObject.h",
    "OCMock/OCObserverMockObject.m",
    "OCMock/OCPartialMockObject.h",
    "OCMock/OCPartialMockObject.m",
    "OCMock/OCProtocolMockObject.h",
    "OCMock/OCProtocolMockObject.m",
  ]

  deps = [ "//testing/gtest" ]
  public_configs = [ ":ocmock_config" ]
  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [
    "//build/config/compiler:no_chromium_code",
  ]
  defines = [ "OCM_DISABLE_XCTEST_FEATURES" ]

  # Do not compile with ARC because OCMock code is not compatible with being
  # compiled with ARC.
  configs -= [ "//build/config/compiler:enable_arc" ]
}