From 68789e7c968adbcb9c5088aa3295a603fde0e8ef Mon Sep 17 00:00:00 2001 From: Noah Gilmore Date: Tue, 31 Jul 2018 08:31:35 -0700 Subject: [PATCH] Fix Obj-C and Swift builds which are broken in v0.6.13 (#192) Summary: 9f807c introduced a new subspec in SonarKit.podspec, which caused Cpp header files to be included in `SonarKit-umbrella.h`, causing all non-ObjC++ project integrations to fail to build (see #190 for more info). SirArkimedes and I investigated this today and found the fix: 1. Make the `CppBridge` subspec's header files private 2. Add a hack to make Cocoapods copy `FBMacros.h` into `{PODS_ROOT}/Headers/Public/SonarKit`, since otherwise `#import "FBMacros.h"` in `SonarKit-umbrella.h` will fail to resolve in out-of-the-box projects. I've put up a branch [here](https://github.com/noahsark769/sonar-testing-example-projects/tree/working_reference) which pulls the pod from this branch and verifies that the fix works. Fixes #190 Pull Request resolved: https://github.com/facebook/Sonar/pull/192 Reviewed By: passy Differential Revision: D9049420 Pulled By: priteshrnandgaonkar fbshipit-source-id: 9383016975607e897085323d64ad44a068199918 --- iOS/FBDefines/FBMacros.h | 16 ---------------- iOS/SonarKit.podspec | 4 +++- 2 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 iOS/FBDefines/FBMacros.h diff --git a/iOS/FBDefines/FBMacros.h b/iOS/FBDefines/FBMacros.h deleted file mode 100644 index 68d86b082..000000000 --- a/iOS/FBDefines/FBMacros.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2004-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - * - */ -#ifndef FB_SK_MACROS_H - #define FB_SK_MACROS_H - - #define FB_LINK_REQUIRE_(NAME, UNIQUE) - #define FB_LINKABLE(NAME) - #define FB_LINK_REQUIRE(NAME) - #define FB_LINK_REQUIRE_EXT(NAME) - -#endif diff --git a/iOS/SonarKit.podspec b/iOS/SonarKit.podspec index 3d1b2a41e..0c4e533b0 100644 --- a/iOS/SonarKit.podspec +++ b/iOS/SonarKit.podspec @@ -31,7 +31,9 @@ Pod::Spec.new do |spec| ss.header_dir = 'CppBridge' ss.compiler_flags = folly_compiler_flags ss.source_files = 'iOS/SonarKit/CppBridge/**/*.{h,mm}' - ss.public_header_files = 'iOS/SonarKit/CppBridge/**/*.h' + # We set these files as private headers since they only need to be accessed + # by other SonarKit source files + ss.private_header_files = 'iOS/SonarKit/CppBridge/**/*.h' ss.preserve_path = 'SonarKit/CppBridge/**/*.h' end