From e0c3d56d3a5dcc68c1a7585275a051d781ade914 Mon Sep 17 00:00:00 2001 From: rh389 Date: Mon, 16 Jan 2017 13:02:21 -0800 Subject: [PATCH] Fix template release build: Add -ObjC and -lc++ to tests target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Fixes https://github.com/facebook/react-native/issues/11861 - the release config is currently broken for projects created by `react-native init` in `master`, 0.40 and 0.39. I'm still investigating when and how this got broken but this seems to be a clean fix. I've added `-ObjC` as well to match the main target but I'm not sure yet whether that's necessary. To test: ``` react-native init fooproject --version react-native@rh389/react-native#missinglinkerflags ``` Open in XCode, Edit scheme (⌘<), Change `Build Configuration` to `Release`, build. Update: The `-lc++` flag became necessary when https://github.com/facebook/react-native/commit/33deaad196834e77a507cad7b13039161258c059 landed because of the libstdc++ dependencies of `RCTLog`. Still not sure about `-ObjC`. javache ? Closes https://github.com/facebook/react-native/pull/11889 Differential Revision: D4421685 Pulled By: javache fbshipit-source-id: 954edaef773f8cef7b7ad671fa4d1f2bfc2f20f2 --- .../HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj b/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj index 4ca07c00e..7bae46685 100644 --- a/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj @@ -966,6 +966,10 @@ INFOPLIST_FILE = HelloWorldTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; }; @@ -979,6 +983,10 @@ INFOPLIST_FILE = HelloWorldTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld"; };