Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: build/mac/copy_asan_runtime_dylib.sh

Issue 18177011: Handle iOS gtest app bundles in copy_asan_runtime_dylib.sh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
@@ -6,8 +6,8 @@
# For app bundles built with ASan, copies the runtime lib
# (libclang_rt.asan_osx_dynamic.dylib), on which their executables depend, from
-# the compiler installation path to appname.app/Contents/Resources and fixes the
-# dylib's install name in the binary to be relative to @executable_path.
+# the compiler installation path into the bundle and fixes the dylib's install
+# name in the binary to be relative to @executable_path.
set -e
@@ -35,12 +35,22 @@
exit 1
fi
-LIBRARIES_DIR="$(dirname "${BINARY_DIR}")/Libraries"
-mkdir -p "${LIBRARIES_DIR}"
+# Check whether the directory containing the executable binary is named
+# "MacOS". In this case we're building a full-fledged OSX app and will put
+# the runtime into appname.app/Contents/Libraries/. Otherwise this is probably
+# an iOS gtest app, and the ASan runtime is put next to the executable.
+UPPER_DIR=$(dirname "${BINARY_DIR}")
+if [ "${UPPER_DIR}" == "MacOS" ]; then
+ LIBRARIES_DIR="${UPPER_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}" \
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698