From bb9d55de32c9e413c325592eb06bc6a1e3361084 Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Wed, 15 Jul 2020 16:22:19 -0700 Subject: [PATCH 1/8] Set OTHER_CFLAGS in the xcode target build settings, so xcode indexer will succeed. If xcode indexer fails, autocomplete operations will not work. --- rules/xcodeproj.bzl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rules/xcodeproj.bzl b/rules/xcodeproj.bzl index 0c19e7ed4..ad1f2fae7 100644 --- a/rules/xcodeproj.bzl +++ b/rules/xcodeproj.bzl @@ -66,6 +66,7 @@ def _xcodeproj_aspect_impl(target, ctx): bazel_build_target_name = "@%s//" % target.label.workspace_name bazel_build_target_name += "%s:%s" % (target.label.package, target.label.name) bazel_bin_subdir = "%s/%s" % (target.label.workspace_root, target.label.package) + if AppleBundleInfo in target: bundle_info = target[AppleBundleInfo] test_host_appname = None @@ -90,6 +91,7 @@ def _xcodeproj_aspect_impl(target, ctx): bazel_bin_subdir = bazel_bin_subdir, srcs = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), asset_srcs = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "asset_srcs")), + other_cflags = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "other_cflags")), build_files = depset(_srcs_info_build_files(ctx), transitive = _get_attr_values_for_name(deps, _SrcsInfo, "build_files")), product_type = bundle_info.product_type[_PRODUCT_SPECIFIER_LENGTH:], platform_type = bundle_info.platform_type, @@ -103,6 +105,7 @@ def _xcodeproj_aspect_impl(target, ctx): _SrcsInfo( srcs = info.srcs, asset_srcs = info.asset_srcs, + other_cflags = info.other_cflags, build_files = depset(_srcs_info_build_files(ctx)), direct_srcs = [], ), @@ -115,6 +118,7 @@ def _xcodeproj_aspect_impl(target, ctx): else: srcs = [] asset_srcs = [] + other_cflags = [] for attr in _dir(ctx.rule.files): if attr == "srcs": srcs += getattr(ctx.rule.files, attr, []) @@ -122,11 +126,20 @@ def _xcodeproj_aspect_impl(target, ctx): asset_srcs += getattr(ctx.rule.files, attr, []) srcs = [f for f in srcs if _is_current_project_file(f)] asset_srcs = [f for f in asset_srcs if _is_current_project_file(f)] + if CcInfo in target: + for fi in target[CcInfo].compilation_context.framework_includes.to_list(): + if fi[0] != '/': + fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi + other_cflags.append("-F%s" % fi) + other_cflags.extend(["-D%s" % di for di in target[CcInfo].compilation_context.defines.to_list()]) + other_cflags.append("-fobjc-arc") # TODO: only apply to arc sources + print("got other cflags %s" % other_cflags) providers.append( _SrcsInfo( srcs = depset(srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), asset_srcs = depset(asset_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "asset_srcs")), + other_cflags = depset(other_cflags, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "other_cflags")), build_files = depset(_srcs_info_build_files(ctx), transitive = _get_attr_values_for_name(deps, _SrcsInfo, "build_files")), direct_srcs = srcs, ), @@ -236,7 +249,7 @@ def _xcodeproj_impl(ctx): "MACH_O_TYPE": target_macho_type, "CLANG_ENABLE_MODULES": "YES", } - + target_settings["OTHER_CFLAGS"] = " ".join(target_info.other_cflags.to_list()) if target_info.product_type == "application": target_settings["INFOPLIST_FILE"] = "$BAZEL_STUBS_DIR/Info-stub.plist" target_settings["PRODUCT_BUNDLE_IDENTIFIER"] = target_info.bundle_id From d074a7631b46ee5e1417e084dfc959df051d6ab9 Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Fri, 17 Jul 2020 08:22:09 -0700 Subject: [PATCH 2/8] address PR feedback --- rules/xcodeproj.bzl | 50 ++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/rules/xcodeproj.bzl b/rules/xcodeproj.bzl index ad1f2fae7..52292d7f6 100644 --- a/rules/xcodeproj.bzl +++ b/rules/xcodeproj.bzl @@ -90,8 +90,10 @@ def _xcodeproj_aspect_impl(target, ctx): bazel_build_target_name = bazel_build_target_name, bazel_bin_subdir = bazel_bin_subdir, srcs = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), + non_arc_srcs = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "non_arc_srcs")), asset_srcs = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "asset_srcs")), - other_cflags = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "other_cflags")), + framework_includes = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "framework_includes")), + cc_defines = depset([], transitive = _get_attr_values_for_name(deps, _SrcsInfo, "cc_defines")), build_files = depset(_srcs_info_build_files(ctx), transitive = _get_attr_values_for_name(deps, _SrcsInfo, "build_files")), product_type = bundle_info.product_type[_PRODUCT_SPECIFIER_LENGTH:], platform_type = bundle_info.platform_type, @@ -104,8 +106,10 @@ def _xcodeproj_aspect_impl(target, ctx): providers.append( _SrcsInfo( srcs = info.srcs, + non_arc_srcs = info.non_arc_srcs, asset_srcs = info.asset_srcs, - other_cflags = info.other_cflags, + framework_includes = info.framework_includes, + cc_defines = info.cc_defines, build_files = depset(_srcs_info_build_files(ctx)), direct_srcs = [], ), @@ -117,29 +121,38 @@ def _xcodeproj_aspect_impl(target, ctx): providers.append(target_info) else: srcs = [] + non_arc_srcs = [] asset_srcs = [] - other_cflags = [] for attr in _dir(ctx.rule.files): if attr == "srcs": srcs += getattr(ctx.rule.files, attr, []) + elif attr == "non_arc_srcs": + non_arc_srcs += getattr(ctx.rule.files, attr, []) else: asset_srcs += getattr(ctx.rule.files, attr, []) srcs = [f for f in srcs if _is_current_project_file(f)] + non_arc_srcs = [f for f in non_arc_srcs if _is_current_project_file(f)] asset_srcs = [f for f in asset_srcs if _is_current_project_file(f)] + # if CcInfo in target: + # for fi in target[CcInfo].framework_includes.framework_includes.to_list(): + # if fi[0] != '/': + # fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi + # framework_includes.append("-F%s" % fi) + # framework_includes.extend(["-D%s" % di for di in target[CcInfo].framework_includes.defines.to_list()]) + # framework_includes.append("-fobjc-arc") # TODO: only apply to arc sources + # print("got other cflags %s" % framework_includes) + framework_includes = [] + cc_defines = [] if CcInfo in target: - for fi in target[CcInfo].compilation_context.framework_includes.to_list(): - if fi[0] != '/': - fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi - other_cflags.append("-F%s" % fi) - other_cflags.extend(["-D%s" % di for di in target[CcInfo].compilation_context.defines.to_list()]) - other_cflags.append("-fobjc-arc") # TODO: only apply to arc sources - print("got other cflags %s" % other_cflags) - + framework_includes = target[CcInfo].compilation_context.framework_includes.to_list() + cc_defines = target[CcInfo].compilation_context.defines.to_list() providers.append( _SrcsInfo( srcs = depset(srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), + non_arc_srcs = depset(asset_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "non_arc_srcs")), asset_srcs = depset(asset_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "asset_srcs")), - other_cflags = depset(other_cflags, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "other_cflags")), + framework_includes = depset(framework_includes, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "framework_includes")), + cc_defines = depset(cc_defines, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "cc_defines")), build_files = depset(_srcs_info_build_files(ctx), transitive = _get_attr_values_for_name(deps, _SrcsInfo, "build_files")), direct_srcs = srcs, ), @@ -230,6 +243,12 @@ def _xcodeproj_impl(ctx): "group": paths.dirname(s.short_path), "optional": True, } for s in target_info.srcs.to_list()] + compiled_non_arc_sources = [{ + "path": paths.join(src_dot_dots, s.short_path), + "group": paths.dirname(s.short_path), + "optional": True, + "compilerFlags": "-fobjc-no-arc", # TODO: why is this not working + } for s in target_info.non_arc_srcs.to_list()] asset_sources = [{ "path": paths.join(src_dot_dots, s.short_path), "group": paths.dirname(s.short_path), @@ -248,8 +267,11 @@ def _xcodeproj_impl(ctx): "BAZEL_BIN_SUBDIR": target_info.bazel_bin_subdir, "MACH_O_TYPE": target_macho_type, "CLANG_ENABLE_MODULES": "YES", + "CLANG_ENABLE_OBJC_ARC": "YES", } - target_settings["OTHER_CFLAGS"] = " ".join(target_info.other_cflags.to_list()) + # TODO + target_settings["FRAMEWORK_SEARCH_PATHS"] = " ".join(target_info.framework_includes.to_list()) + target_settings["GCC_PREPROCESSOR_DEFINITIONS"] = " ".join(target_info.cc_defines.to_list()) if target_info.product_type == "application": target_settings["INFOPLIST_FILE"] = "$BAZEL_STUBS_DIR/Info-stub.plist" target_settings["PRODUCT_BUNDLE_IDENTIFIER"] = target_info.bundle_id @@ -264,7 +286,7 @@ def _xcodeproj_impl(ctx): target_settings["VALID_ARCHS"] = _ARCH_MAPPING[target_info.platform_type] xcodeproj_targets_by_name[target_info.name] = { - "sources": compiled_sources + asset_sources, + "sources": compiled_sources + compiled_non_arc_sources + asset_sources, "type": target_info.product_type, "platform": _PLATFORM_MAPPING[target_info.platform_type], "deploymentTarget": target_info.minimum_os_version, From 38c5d46d4f9ef740d0c665c5858dfbf4d16bb413 Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Tue, 21 Jul 2020 10:01:31 -0700 Subject: [PATCH 3/8] fixes and tweaks --- rules/xcodeproj.bzl | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/rules/xcodeproj.bzl b/rules/xcodeproj.bzl index 52292d7f6..f49fa10e9 100644 --- a/rules/xcodeproj.bzl +++ b/rules/xcodeproj.bzl @@ -133,26 +133,18 @@ def _xcodeproj_aspect_impl(target, ctx): srcs = [f for f in srcs if _is_current_project_file(f)] non_arc_srcs = [f for f in non_arc_srcs if _is_current_project_file(f)] asset_srcs = [f for f in asset_srcs if _is_current_project_file(f)] - # if CcInfo in target: - # for fi in target[CcInfo].framework_includes.framework_includes.to_list(): - # if fi[0] != '/': - # fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi - # framework_includes.append("-F%s" % fi) - # framework_includes.extend(["-D%s" % di for di in target[CcInfo].framework_includes.defines.to_list()]) - # framework_includes.append("-fobjc-arc") # TODO: only apply to arc sources - # print("got other cflags %s" % framework_includes) - framework_includes = [] - cc_defines = [] + framework_includes = _get_attr_values_for_name(deps, _SrcsInfo, "framework_includes") + cc_defines = _get_attr_values_for_name(deps, _SrcsInfo, "cc_defines") if CcInfo in target: - framework_includes = target[CcInfo].compilation_context.framework_includes.to_list() - cc_defines = target[CcInfo].compilation_context.defines.to_list() + framework_includes.append(target[CcInfo].compilation_context.framework_includes) + cc_defines.append(target[CcInfo].compilation_context.defines) providers.append( _SrcsInfo( srcs = depset(srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), - non_arc_srcs = depset(asset_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "non_arc_srcs")), + non_arc_srcs = depset(non_arc_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "non_arc_srcs")), asset_srcs = depset(asset_srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "asset_srcs")), - framework_includes = depset(framework_includes, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "framework_includes")), - cc_defines = depset(cc_defines, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "cc_defines")), + framework_includes = depset([], transitive = framework_includes), + cc_defines = depset([], transitive = cc_defines), build_files = depset(_srcs_info_build_files(ctx), transitive = _get_attr_values_for_name(deps, _SrcsInfo, "build_files")), direct_srcs = srcs, ), @@ -269,9 +261,13 @@ def _xcodeproj_impl(ctx): "CLANG_ENABLE_MODULES": "YES", "CLANG_ENABLE_OBJC_ARC": "YES", } - # TODO - target_settings["FRAMEWORK_SEARCH_PATHS"] = " ".join(target_info.framework_includes.to_list()) - target_settings["GCC_PREPROCESSOR_DEFINITIONS"] = " ".join(target_info.cc_defines.to_list()) + framework_search_paths = [] + for fi in target_info.framework_includes.to_list(): + if fi[0] != '/': + fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi + framework_search_paths.append("\"%s\"" % fi) + target_settings["FRAMEWORK_SEARCH_PATHS"] = " ".join(framework_search_paths) + target_settings["GCC_PREPROCESSOR_DEFINITIONS"] = " ".join(["\"%s\"" % d for d in target_info.cc_defines.to_list()]) if target_info.product_type == "application": target_settings["INFOPLIST_FILE"] = "$BAZEL_STUBS_DIR/Info-stub.plist" target_settings["PRODUCT_BUNDLE_IDENTIFIER"] = target_info.bundle_id From 578ac9291bfd6d1ed19a24576d9cf84f26abfd98 Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Wed, 22 Jul 2020 13:06:09 -0700 Subject: [PATCH 4/8] Add non arc sources, handle them correctly, update project files --- rules/xcodeproj.bzl | 2 +- tests/macos/xcodeproj/BUILD.bazel | 2 ++ tests/macos/xcodeproj/NonArcObject.h | 2 ++ tests/macos/xcodeproj/NonArcObject.m | 4 ++++ .../project.pbxproj | 24 +++++++++++++++++++ .../project.pbxproj | 24 +++++++++++++++++++ .../project.pbxproj | 24 +++++++++++++++++++ tests/macos/xcodeproj/test.swift | 7 ++++++ 8 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 tests/macos/xcodeproj/NonArcObject.h create mode 100644 tests/macos/xcodeproj/NonArcObject.m diff --git a/rules/xcodeproj.bzl b/rules/xcodeproj.bzl index f49fa10e9..b6d18ae1f 100644 --- a/rules/xcodeproj.bzl +++ b/rules/xcodeproj.bzl @@ -239,7 +239,7 @@ def _xcodeproj_impl(ctx): "path": paths.join(src_dot_dots, s.short_path), "group": paths.dirname(s.short_path), "optional": True, - "compilerFlags": "-fobjc-no-arc", # TODO: why is this not working + "compilerFlags": "-fno-objc-arc", } for s in target_info.non_arc_srcs.to_list()] asset_sources = [{ "path": paths.join(src_dot_dots, s.short_path), diff --git a/tests/macos/xcodeproj/BUILD.bazel b/tests/macos/xcodeproj/BUILD.bazel index 5dbf286fa..6ae68e86e 100644 --- a/tests/macos/xcodeproj/BUILD.bazel +++ b/tests/macos/xcodeproj/BUILD.bazel @@ -5,6 +5,7 @@ load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl ios_unit_test( name = "Single-Application-UnitTests", srcs = ["test.swift"], + non_arc_srcs = ["NonArcObject.h", "NonArcObject.m"], args = ["-h"], env = { "test_envvar_key1": "test_envvar_value1", @@ -13,6 +14,7 @@ ios_unit_test( minimum_os_version = "11.0", module_name = "Single_Application_UnitTests", sdk_frameworks = ["XCTest"], + defines = ["REQUIRED_DEFINED_FLAG"], ) default_ios_test_runner( diff --git a/tests/macos/xcodeproj/NonArcObject.h b/tests/macos/xcodeproj/NonArcObject.h new file mode 100644 index 000000000..166e88c6a --- /dev/null +++ b/tests/macos/xcodeproj/NonArcObject.h @@ -0,0 +1,2 @@ +@interface NonArcObject +@end diff --git a/tests/macos/xcodeproj/NonArcObject.m b/tests/macos/xcodeproj/NonArcObject.m new file mode 100644 index 000000000..e034f3161 --- /dev/null +++ b/tests/macos/xcodeproj/NonArcObject.m @@ -0,0 +1,4 @@ +#import "NonArcObject.h" + +@implementation NonArcObject +@end diff --git a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj index e736afb41..c7d8837dd 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj +++ b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 0834EB3BB2BE0990DEED46BD /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1162A80978C527830EDADEE /* test.swift */; }; 6868785A8F571C49259B50E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EEB1C98DB4C8E24414A69917 /* main.m */; }; + 8A8AC7C1D053F87A0D991815 /* NonArcObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E881738E1AAC1FCA61D467D8 /* NonArcObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; E8D5A100DC66B1E35BB71538 /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1162A80978C527830EDADEE /* test.swift */; }; /* End PBXBuildFile section */ @@ -19,8 +20,10 @@ 7ABD95023B71172929B010EE /* common.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common.pch; path = ../../../rules/library/common.pch; sourceTree = ""; }; 908EFE5EAE901D6B372D68F7 /* ios.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = ios.entitlements; path = ../../../rules/test_host_app/ios.entitlements; sourceTree = ""; }; A05E016687115D20E64A5C60 /* BUILD.bazel */ = {isa = PBXFileReference; name = BUILD.bazel; path = BUILD.bazel; sourceTree = ""; }; + B63432B3F93F02853868034C /* NonArcObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NonArcObject.h; path = NonArcObject.h; sourceTree = ""; }; BA5C2481E04D8592323A7AD9 /* BUILD.bazel */ = {isa = PBXFileReference; name = BUILD.bazel; path = ../../../rules/test_host_app/BUILD.bazel; sourceTree = ""; }; BFC300E7CF04688067094BFF /* Contents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Contents.json; path = ../../../rules/test_host_app/AssetCatalogFixture.xcassets/Contents.json; sourceTree = ""; }; + E881738E1AAC1FCA61D467D8 /* NonArcObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NonArcObject.m; path = NonArcObject.m; sourceTree = ""; }; EEB1C98DB4C8E24414A69917 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ../../../rules/test_host_app/main.m; sourceTree = ""; }; EFADB1CE81C3F97F647C9255 /* Single-Application-UnitTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = "Single-Application-UnitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; F1162A80978C527830EDADEE /* test.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = test.swift; path = test.swift; sourceTree = ""; }; @@ -103,6 +106,8 @@ isa = PBXGroup; children = ( A05E016687115D20E64A5C60 /* BUILD.bazel */, + B63432B3F93F02853868034C /* NonArcObject.h */, + E881738E1AAC1FCA61D467D8 /* NonArcObject.m */, F1162A80978C527830EDADEE /* test.swift */, ); name = xcodeproj; @@ -265,6 +270,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8A8AC7C1D053F87A0D991815 /* NonArcObject.m in Sources */, E8D5A100DC66B1E35BB71538 /* test.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -277,6 +283,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-UnitTests"; @@ -290,6 +299,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -304,6 +316,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -366,6 +381,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -379,6 +397,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -392,6 +413,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-UnitTests"; diff --git a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj index 246757d59..5a3ac6c4e 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj +++ b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 53E65376450A485B39CE93FE /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD63CC255956E60D898C7B7 /* test.swift */; }; + 706F35140D56EA1BB820A681 /* NonArcObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B1396A59924BC26C630854 /* NonArcObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 83D9B2BE42CE395FCC9356FB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DA260AA799ED8A57078C331 /* main.m */; }; B868F40E021F743023B7764F /* test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD63CC255956E60D898C7B7 /* test.swift */; }; /* End PBXBuildFile section */ @@ -19,11 +20,13 @@ 4936F4D0B63B32AD09E63C43 /* BUILD.bazel */ = {isa = PBXFileReference; name = BUILD.bazel; path = BUILD.bazel; sourceTree = ""; }; 58D47D35D8B8E34549EE944E /* Contents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Contents.json; path = ../../../rules/test_host_app/AssetCatalogFixture.xcassets/Contents.json; sourceTree = ""; }; 712BB7D3F966AAE042C40E4E /* iOS-12.0-AppHost.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = "iOS-12.0-AppHost.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 77B1396A59924BC26C630854 /* NonArcObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = NonArcObject.m; path = NonArcObject.m; sourceTree = ""; }; 9735D50F44B3B4D188BA18BF /* Single-Application-RunnableTestSuite.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = "Single-Application-RunnableTestSuite.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CF248CD4BA2D7D91429E9BCB /* common.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common.pch; path = ../../../rules/library/common.pch; sourceTree = ""; }; E94B0DB5FD5082DE73F52008 /* Single-Application-UnitTests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = "Single-Application-UnitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; EAEB79BE70BFB649A6FBC92C /* BUILD.bazel */ = {isa = PBXFileReference; name = BUILD.bazel; path = ../../../rules/test_host_app/BUILD.bazel; sourceTree = ""; }; F689E871A09EA979611C589A /* resource_bundle.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = resource_bundle.plist; path = ../../../rules/library/resource_bundle.plist; sourceTree = ""; }; + FE2DCE7EA91C1CAF4050351A /* NonArcObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NonArcObject.h; path = NonArcObject.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXGroup section */ @@ -103,6 +106,8 @@ isa = PBXGroup; children = ( 4936F4D0B63B32AD09E63C43 /* BUILD.bazel */, + FE2DCE7EA91C1CAF4050351A /* NonArcObject.h */, + 77B1396A59924BC26C630854 /* NonArcObject.m */, 0BD63CC255956E60D898C7B7 /* test.swift */, ); name = xcodeproj; @@ -249,6 +254,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 706F35140D56EA1BB820A681 /* NonArcObject.m in Sources */, 53E65376450A485B39CE93FE /* test.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -277,6 +283,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -290,6 +299,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-UnitTests"; @@ -327,6 +339,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -341,6 +356,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -355,6 +373,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -392,6 +413,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /tests/macos/xcodeproj; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-UnitTests"; diff --git a/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/project.pbxproj b/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/project.pbxproj index 519699820..38268101b 100755 --- a/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/project.pbxproj +++ b/tests/macos/xcodeproj/Test-Target-With-Test-Host-Project.xcodeproj/project.pbxproj @@ -385,6 +385,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f22bcf18950e92551e6bc2e43803228c8d15233d48c88265af0229927f68339f/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "TestImports-Unit-Tests"; @@ -399,6 +402,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f22bcf18950e92551e6bc2e43803228c8d15233d48c88265af0229927f68339f/bin/tests/ios/unit-test/test-imports-app/SomeFramework\""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -413,6 +419,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f22bcf18950e92551e6bc2e43803228c8d15233d48c88265af0229927f68339f/bin/tests/ios/unit-test/test-imports-app/TestImports-App_framework_unlinked\""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "TestImports-Unit-Tests"; @@ -427,6 +436,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = DefaultHosted; @@ -441,6 +453,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test/test-imports-app"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = "\"$BAZEL_WORKSPACE_ROOT/bazel-out/applebin_ios-ios_x86_64-fastbuild-ST-f22bcf18950e92551e6bc2e43803228c8d15233d48c88265af0229927f68339f/bin/tests/ios/unit-test/test-imports-app/SomeFramework\""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MACH_O_TYPE = "$(inherited)"; @@ -479,6 +494,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MACH_O_TYPE = "$(inherited)"; @@ -493,6 +511,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = /rules/test_host_app; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; INFOPLIST_FILE = "$BAZEL_STUBS_DIR/Info-stub.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MACH_O_TYPE = "$(inherited)"; @@ -531,6 +552,9 @@ buildSettings = { BAZEL_BIN_SUBDIR = "/tests/ios/unit-test"; CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + FRAMEWORK_SEARCH_PATHS = ""; + GCC_PREPROCESSOR_DEFINITIONS = ""; IPHONEOS_DEPLOYMENT_TARGET = 10.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = DefaultHosted; diff --git a/tests/macos/xcodeproj/test.swift b/tests/macos/xcodeproj/test.swift index 9983589d1..9d00d9d61 100644 --- a/tests/macos/xcodeproj/test.swift +++ b/tests/macos/xcodeproj/test.swift @@ -1,9 +1,16 @@ import XCTest +import TestHostModule class SwiftTests : XCTestCase { func testPasses() { XCTAssertTrue(true) } + func testPreprocessorDefinesFlag() { + #if REQUIRED_DEFINED_FLAG + #else + XCTAssertTrue(false) + #endif // REQUIRED_DEFINED_FLAG + } func testTestEnvArgsMatches() { XCTAssertEqual(ProcessInfo.processInfo.environment["test_envvar_key1"], "test_envvar_value1") XCTAssertEqual(ProcessInfo.processInfo.environment["test_envvar_key2"], "test_envvar_value2_overridenvalue") From bca686c394963b538ebd73757a3912edefa57f08 Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Wed, 22 Jul 2020 13:08:49 -0700 Subject: [PATCH 5/8] buildifier fixes --- rules/xcodeproj.bzl | 10 +++++----- tests/macos/xcodeproj/BUILD.bazel | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/rules/xcodeproj.bzl b/rules/xcodeproj.bzl index b6d18ae1f..8e2d46f2f 100644 --- a/rules/xcodeproj.bzl +++ b/rules/xcodeproj.bzl @@ -136,8 +136,8 @@ def _xcodeproj_aspect_impl(target, ctx): framework_includes = _get_attr_values_for_name(deps, _SrcsInfo, "framework_includes") cc_defines = _get_attr_values_for_name(deps, _SrcsInfo, "cc_defines") if CcInfo in target: - framework_includes.append(target[CcInfo].compilation_context.framework_includes) - cc_defines.append(target[CcInfo].compilation_context.defines) + framework_includes.append(target[CcInfo].compilation_context.framework_includes) + cc_defines.append(target[CcInfo].compilation_context.defines) providers.append( _SrcsInfo( srcs = depset(srcs, transitive = _get_attr_values_for_name(deps, _SrcsInfo, "srcs")), @@ -263,9 +263,9 @@ def _xcodeproj_impl(ctx): } framework_search_paths = [] for fi in target_info.framework_includes.to_list(): - if fi[0] != '/': - fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi - framework_search_paths.append("\"%s\"" % fi) + if fi[0] != "/": + fi = "$BAZEL_WORKSPACE_ROOT/%s" % fi + framework_search_paths.append("\"%s\"" % fi) target_settings["FRAMEWORK_SEARCH_PATHS"] = " ".join(framework_search_paths) target_settings["GCC_PREPROCESSOR_DEFINITIONS"] = " ".join(["\"%s\"" % d for d in target_info.cc_defines.to_list()]) if target_info.product_type == "application": diff --git a/tests/macos/xcodeproj/BUILD.bazel b/tests/macos/xcodeproj/BUILD.bazel index 6ae68e86e..901fbe6c3 100644 --- a/tests/macos/xcodeproj/BUILD.bazel +++ b/tests/macos/xcodeproj/BUILD.bazel @@ -5,16 +5,19 @@ load("@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl ios_unit_test( name = "Single-Application-UnitTests", srcs = ["test.swift"], - non_arc_srcs = ["NonArcObject.h", "NonArcObject.m"], args = ["-h"], + defines = ["REQUIRED_DEFINED_FLAG"], env = { "test_envvar_key1": "test_envvar_value1", "test_envvar_key2": "test_envvar_value2", }, minimum_os_version = "11.0", module_name = "Single_Application_UnitTests", + non_arc_srcs = [ + "NonArcObject.h", + "NonArcObject.m", + ], sdk_frameworks = ["XCTest"], - defines = ["REQUIRED_DEFINED_FLAG"], ) default_ios_test_runner( From 3163c7609b8ddda10c61e2c891a06ba36bbeb25c Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Wed, 22 Jul 2020 13:28:09 -0700 Subject: [PATCH 6/8] fix build issue --- tests/macos/xcodeproj/test.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/macos/xcodeproj/test.swift b/tests/macos/xcodeproj/test.swift index 9d00d9d61..85cc4c969 100644 --- a/tests/macos/xcodeproj/test.swift +++ b/tests/macos/xcodeproj/test.swift @@ -1,5 +1,4 @@ import XCTest -import TestHostModule class SwiftTests : XCTestCase { func testPasses() { From 564db51bb0ff14d75dcacf742c132ec2d8e9720b Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Wed, 22 Jul 2020 16:06:42 -0700 Subject: [PATCH 7/8] Add preprocessor defines flag to all necessary test suites --- tests/macos/xcodeproj/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/macos/xcodeproj/BUILD.bazel b/tests/macos/xcodeproj/BUILD.bazel index 901fbe6c3..bcf49cd49 100644 --- a/tests/macos/xcodeproj/BUILD.bazel +++ b/tests/macos/xcodeproj/BUILD.bazel @@ -38,6 +38,7 @@ ios_unit_test( name = "Single-Application-RunnableTestSuite", srcs = ["test.swift"], args = ["-h"], + defines = ["REQUIRED_DEFINED_FLAG"], env = { "test_envvar_key1": "test_envvar_value1", "test_envvar_key2": "test_envvar_value2", From fc2eb7e3f82924a7dca016200d8b41ae5340d19c Mon Sep 17 00:00:00 2001 From: Amber Dixon Date: Thu, 23 Jul 2020 07:26:52 -0700 Subject: [PATCH 8/8] Apply diffs to xcodeprojs --- .../project.pbxproj | 4 ++-- .../project.pbxproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj index c7d8837dd..d8120482d 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj +++ b/tests/macos/xcodeproj/Single-Application-Project-AllTargets.xcodeproj/project.pbxproj @@ -383,7 +383,7 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; FRAMEWORK_SEARCH_PATHS = ""; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -399,7 +399,7 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; FRAMEWORK_SEARCH_PATHS = ""; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; diff --git a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj index 5a3ac6c4e..4d9a9c6b5 100755 --- a/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj +++ b/tests/macos/xcodeproj/Single-Application-Project-DirectTargetsOnly.xcodeproj/project.pbxproj @@ -285,7 +285,7 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; FRAMEWORK_SEARCH_PATHS = ""; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite"; @@ -375,7 +375,7 @@ CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; FRAMEWORK_SEARCH_PATHS = ""; - GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_PREPROCESSOR_DEFINITIONS = "\"REQUIRED_DEFINED_FLAG\""; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MACH_O_TYPE = "$(inherited)"; PRODUCT_NAME = "Single-Application-RunnableTestSuite";