Index: build/mac/copy_asan_runtime_dylib.sh |
=================================================================== |
--- build/mac/copy_asan_runtime_dylib.sh (revision 208704) |
+++ build/mac/copy_asan_runtime_dylib.sh (working copy) |
@@ -35,12 +35,21 @@ |
exit 1 |
fi |
-LIBRARIES_DIR="$(dirname "${BINARY_DIR}")/Libraries" |
-mkdir -p "${LIBRARIES_DIR}" |
+# Check whether the directory containing the executable binary has an .app |
+# extension. In this case we're probably building an iOS gtest app, |
+# otherwise it is a regular OSX application. |
+BINARY_DIR_EXT=$(echo "${BINARY_DIR}" | sed 's/^.*\.//') |
Nico
2013/06/28 19:11:40
I don't think that's the right check. From what I
Alexander Potapenko
2013/07/01 08:35:01
The binary resides in Contents/MacOS, how about ch
|
+if [ "$BINARY_DIR_EXT" != "app" ]; then |
+ LIBRARIES_DIR="$(dirname "${BINARY_DIR}")/Libraries" |
+ mkdir -p "${LIBRARIES_DIR}" |
+ NEW_LC_ID_DYLIB="@executable_path/../Libraries/${ASAN_DYLIB_NAME}" |
+else |
+ LIBRARIES_DIR="${BINARY_DIR}" |
+ NEW_LC_ID_DYLIB="@executable_path/${ASAN_DYLIB_NAME}" |
+fi |
+ |
cp "${ASAN_DYLIB}" "${LIBRARIES_DIR}" |
-NEW_LC_ID_DYLIB="@executable_path/../Libraries/${ASAN_DYLIB_NAME}" |
- |
# Make LC_ID_DYLIB of the runtime copy point to its location. |
install_name_tool \ |
-id "${NEW_LC_ID_DYLIB}" \ |