summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-09-11 10:26:54 +0000
committerAlexey Samsonov <samsonov@google.com>2012-09-11 10:26:54 +0000
commit70a7095e37289746fd20595457d517faf66dc6a4 (patch)
treebdf01e63dc72658673899d78bd2c06185cfc5bdf /lib
parent374520df0a4fde014380298d00bad4064de3e476 (diff)
[compiler-rt] Install support for CMake build of compiler-rt
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt28
-rw-r--r--lib/asan/CMakeLists.txt4
2 files changed, 4 insertions, 28 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 4961e2d0c..1249aa00e 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,29 +1,3 @@
-# Compute the Clang version from the LLVM version.
-# FIXME: We should be able to reuse CLANG_VERSION variable calculated
-# in Clang cmake files, instead of copying the rules here.
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
- ${PACKAGE_VERSION})
-
-# Call add_clang_runtime_static_library(<target_library>) to make
-# sure that static <target_library> is built in the directory
-# where Clang driver expects to find it.
-if (APPLE)
- set(CLANG_RUNTIME_LIB_DIR
- ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/darwin)
-elseif (UNIX)
- # Assume Linux.
- set(CLANG_RUNTIME_LIB_DIR
- ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/linux)
-endif()
-function(add_clang_runtime_static_library)
- 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.
add_subdirectory(asan)
@@ -178,6 +152,7 @@ if(CAN_TARGET_X86_64)
${GENERIC_SOURCES}
)
set_target_properties(clang_rt.x86_64 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_X86_64_CFLAGS}")
+ add_clang_compiler_rt_libraries(clang_rt.x86_64)
endif()
if(CAN_TARGET_I386)
add_library(clang_rt.i386 STATIC
@@ -198,4 +173,5 @@ if(CAN_TARGET_I386)
${GENERIC_SOURCES}
)
set_target_properties(clang_rt.i386 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_I386_CFLAGS}")
+ add_clang_compiler_rt_libraries(clang_rt.i386)
endif()
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt
index 82b3e7dbd..235087f83 100644
--- a/lib/asan/CMakeLists.txt
+++ b/lib/asan/CMakeLists.txt
@@ -93,7 +93,7 @@ endif()
set_property(TARGET ${ASAN_RUNTIME_LIBRARIES} APPEND PROPERTY
COMPILE_DEFINITIONS ${ASAN_COMMON_DEFINITIONS})
-add_clang_runtime_static_library(${ASAN_RUNTIME_LIBRARIES})
+add_clang_compiler_rt_libraries(${ASAN_RUNTIME_LIBRARIES})
set(ASAN_DYNAMIC_RUNTIME_LIBRARIES)
if(APPLE)
@@ -111,7 +111,7 @@ if(APPLE)
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})
+add_clang_compiler_rt_libraries(${ASAN_DYNAMIC_RUNTIME_LIBRARIES})
if(LLVM_INCLUDE_TESTS)