I have a workspace with a project which links with the static libraries in another project (which is also in the workspace). It\'s a problem in Kobold2D I haven\'t been able
I have a similar problem using CocoaPods and trying to have more than one Adhoc (or Enterprise, or Beta) configurations.
Here is what seems to work (let's say that both projects are lying in the same xcworkspace):
Add the subproject generated lib to the mainproject Link Binary with Libraries.
As the configuration Adhoc is not known by the subproject, Xcode will use the Release config as a fallback (or maybe the first config of the list) when building it.
The linker will complain because it cannot find the lib… ok, let's handle this one.
Add a Run Script build phase to the mainproject, right after the Target Dependencies phase. Enter this script:
if [ "$CONFIGURATION" = "Adhoc" ]; then
echo "====================================="
echo "Copying libPods Release into the Adhoc product build dir!"
echo "====================================="
cp "$BUILT_PRODUCTS_DIR/../Release-$PLATFORM_NAME/libPods.a" "$BUILT_PRODUCTS_DIR"
else
echo "No manual lib copy."
fi
This will copy the lib generated by the subproject Release build (which will happen when mainproject is built) in the Adhoc build directory, so that the linker will find the lib. And we should be good to go! Yeah!