From 643a19459ffee79ba7347266389e247ac2e7b864 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Wed, 2 Sep 2020 10:57:30 -0700 Subject: [PATCH 1/2] WIP trying to get mac test to be able to import OCMock --- build/secondary/third_party/ocmock/BUILD.gn | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/secondary/third_party/ocmock/BUILD.gn b/build/secondary/third_party/ocmock/BUILD.gn index 757ab3ac00..51875cc1b3 100644 --- a/build/secondary/third_party/ocmock/BUILD.gn +++ b/build/secondary/third_party/ocmock/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -assert(is_ios) +#assert(is_ios) ocmock_path = "//third_party/ocmock/Source" @@ -17,9 +17,13 @@ static_library("ocmock") { all_dependent_configs = [ ":ocmock_config" ] cflags = [ "-fvisibility=default", - "-mios-simulator-version-min=$ios_testing_deployment_target", + #"-mios-simulator-version-min=$ios_testing_deployment_target", "-Wno-misleading-indentation", + "-ObjC", ] + + # TODO(justinmc): Split out the sources here into a separate source_set, and + # create another static_library called ocmock_mac. sources = [ "$ocmock_path/OCMock/NSInvocation+OCMAdditions.h", "$ocmock_path/OCMock/NSInvocation+OCMAdditions.m", From de1709a5ed1a6f3dd915cfcd205e83040db572eb Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Wed, 2 Sep 2020 17:07:15 -0700 Subject: [PATCH 2/2] Separate target for Mac courtesy of @gaaclarke --- build/secondary/third_party/ocmock/BUILD.gn | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/build/secondary/third_party/ocmock/BUILD.gn b/build/secondary/third_party/ocmock/BUILD.gn index 51875cc1b3..6ffb644364 100644 --- a/build/secondary/third_party/ocmock/BUILD.gn +++ b/build/secondary/third_party/ocmock/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -#assert(is_ios) - ocmock_path = "//third_party/ocmock/Source" # OCMock headers use `#import `. @@ -11,19 +9,13 @@ config("ocmock_config") { include_dirs = [ "$ocmock_path" ] } -# This is a static library so it can be used by xcode's build system too. -static_library("ocmock") { +source_set("ocmock_src") { configs -= [ "//build/config/compiler:chromium_code" ] all_dependent_configs = [ ":ocmock_config" ] cflags = [ "-fvisibility=default", - #"-mios-simulator-version-min=$ios_testing_deployment_target", "-Wno-misleading-indentation", - "-ObjC", ] - - # TODO(justinmc): Split out the sources here into a separate source_set, and - # create another static_library called ocmock_mac. sources = [ "$ocmock_path/OCMock/NSInvocation+OCMAdditions.h", "$ocmock_path/OCMock/NSInvocation+OCMAdditions.m", @@ -96,3 +88,14 @@ static_library("ocmock") { ] } +# This is a static library so it can be used by xcode's build system too. +static_library("ocmock") { + if (is_ios) { + cflags = [ + "-mios-simulator-version-min=$ios_testing_deployment_target", + ] + } + public_deps = [ + ":ocmock_src", + ] +}