diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 08:17:25 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 08:17:25 +0000 |
commit | add820151028bef7148b7b5f2660f6c30e59e86b (patch) | |
tree | df63c9af8bcb819dbe9d07862f322018c5a39833 /build/mac | |
parent | 05f890b325e90b7fcdc112e8200d90eb8977b5c9 (diff) | |
download | chromium_src-add820151028bef7148b7b5f2660f6c30e59e86b.zip chromium_src-add820151028bef7148b7b5f2660f6c30e59e86b.tar.gz chromium_src-add820151028bef7148b7b5f2660f6c30e59e86b.tar.bz2 |
Handle iOS gtest app bundles in copy_asan_runtime_dylib.sh
Unlike Chromium.app, gtest binaries contain the executable right on the first level
(e.g. base_unittests.app/base_unittests), so the ASan runtime can be put right into the bundle.
R=stuartmorgan@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/18177011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/mac')
-rwxr-xr-x | build/mac/copy_asan_runtime_dylib.sh | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/build/mac/copy_asan_runtime_dylib.sh b/build/mac/copy_asan_runtime_dylib.sh index beefe79..b67b434 100755 --- a/build/mac/copy_asan_runtime_dylib.sh +++ b/build/mac/copy_asan_runtime_dylib.sh @@ -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,11 +35,21 @@ if [[ "${DYLIB_BASENAME}" != "${ASAN_DYLIB_NAME}" ]]; then exit 1 fi -LIBRARIES_DIR="$(dirname "${BINARY_DIR}")/Libraries" -mkdir -p "${LIBRARIES_DIR}" -cp "${ASAN_DYLIB}" "${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 -NEW_LC_ID_DYLIB="@executable_path/../Libraries/${ASAN_DYLIB_NAME}" +cp "${ASAN_DYLIB}" "${LIBRARIES_DIR}" # Make LC_ID_DYLIB of the runtime copy point to its location. install_name_tool \ |