summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-03-19 09:17:35 +0000
committerAlexey Samsonov <samsonov@google.com>2013-03-19 09:17:35 +0000
commitc9de451e97b85e9712939ac2bfb02295645e2e0f (patch)
tree7ae0943977a36b33ddd6b142156c44efef72163e /lib
parent210ce0ee0190170ca6fab6f5d953885ce5f9ac89 (diff)
Support CMake build of profile runtime library on Linux
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt4
-rw-r--r--lib/profile/CMakeLists.txt13
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 2538a4df3..81726e032 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -15,10 +15,10 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
add_subdirectory(tsan)
add_subdirectory(msan)
add_subdirectory(msandr)
+ # FIXME: Add support for the profile library on OS X.
+ add_subdirectory(profile)
endif()
-# FIXME: Add support for the profile library.
-
# The top-level lib directory contains a large amount of C code which provides
# generic implementations of the core runtime library along with optimized
# architecture-specific code in various subdirectories.
diff --git a/lib/profile/CMakeLists.txt b/lib/profile/CMakeLists.txt
new file mode 100644
index 000000000..70fc17506
--- /dev/null
+++ b/lib/profile/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(PROFILE_SOURCES
+ GCDAProfiling.c)
+
+filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386)
+
+if(NOT APPLE)
+ # FIXME: Add support for profile.rt on Mac.
+ foreach(arch ${PROFILE_SUPPORTED_ARCH})
+ add_compiler_rt_static_runtime(clang_rt.profile-${arch} ${arch}
+ SOURCES ${PROFILE_SOURCES}
+ CFLAGS --sysroot=${COMPILER_RT_LINUX_SDK_SYSROOT})
+ endforeach()
+endif()