Add add_clang_runtime_shared_library() CMake function and use it to put the shared ASan runtime in the appropriate place.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162546 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 72ab9b4..4961e2d 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -19,6 +19,10 @@
   set_target_properties(${ARGN} PROPERTIES
                         ARCHIVE_OUTPUT_DIRECTORY ${CLANG_RUNTIME_LIB_DIR})
 endfunction()
+function(add_clang_runtime_shared_library)
+  set_target_properties(${ARGN} PROPERTIES
+                        LIBRARY_OUTPUT_DIRECTORY ${CLANG_RUNTIME_LIB_DIR})
+endfunction()
 
 # First, add the subdirectories which contain feature-based runtime libraries
 # and several convenience helper libraries.
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt
index 7f552b0..d626d3b 100644
--- a/lib/asan/CMakeLists.txt
+++ b/lib/asan/CMakeLists.txt
@@ -116,6 +116,7 @@
     LINK_FLAGS "-framework Foundation")
   list(APPEND ASAN_DYNAMIC_RUNTIME_LIBRARIES clang_rt.asan_osx_dynamic)
 endif()
+add_clang_runtime_shared_library(${ASAN_DYNAMIC_RUNTIME_LIBRARIES})
 
 
 if(LLVM_INCLUDE_TESTS)