Skip to content

Commit 2b087c2

Browse files
robhogangrabbou
authored andcommitted
Fix template release build: Add -ObjC and -lc++ to tests target
Summary: Fixes #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 33deaad landed because of the libstdc++ dependencies of `RCTLog`. Still not sure about `-ObjC`. javache ? Closes #11889 Differential Revision: D4421685 Pulled By: javache fbshipit-source-id: 954edaef773f8cef7b7ad671fa4d1f2bfc2f20f2
1 parent 7f98028 commit 2b087c2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

local-cli/templates/HelloWorld/ios/HelloWorld.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,10 @@
966966
INFOPLIST_FILE = HelloWorldTests/Info.plist;
967967
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
968968
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
969+
OTHER_LDFLAGS = (
970+
"-ObjC",
971+
"-lc++",
972+
);
969973
PRODUCT_NAME = "$(TARGET_NAME)";
970974
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld";
971975
};
@@ -979,6 +983,10 @@
979983
INFOPLIST_FILE = HelloWorldTests/Info.plist;
980984
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
981985
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
986+
OTHER_LDFLAGS = (
987+
"-ObjC",
988+
"-lc++",
989+
);
982990
PRODUCT_NAME = "$(TARGET_NAME)";
983991
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld";
984992
};

0 commit comments

Comments
 (0)