summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-01-20 14:36:12 +0000
committerAlexey Samsonov <samsonov@google.com>2013-01-20 14:36:12 +0000
commit5162314d9538766717b8b6cf3d4a32e88c34bb57 (patch)
tree7e2cec7ec3a2ab178792936379cd6bb34cebeb22 /cmake
parent7eca152ea59510d51b01b764fc96852a34e9d6bc (diff)
downloadcompiler-rt-5162314d9538766717b8b6cf3d4a32e88c34bb57.tar.gz
compiler-rt-5162314d9538766717b8b6cf3d4a32e88c34bb57.tar.bz2
compiler-rt-5162314d9538766717b8b6cf3d4a32e88c34bb57.tar.xz
CMake: Add add_compiler_rt_osx_object_library to create universal libraries on Mac
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 0d4317e4..7014d172 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -18,6 +18,20 @@ macro(add_compiler_rt_object_library name arch)
endif()
endmacro()
+# Same as above, but adds universal osx library with name "<name>.osx"
+# targeting multiple architectures.
+# add_compiler_rt_osx_object_library(<name> ARCH <architectures>
+# SOURCES <source files>
+# CFLAGS <compile flags>)
+macro(add_compiler_rt_osx_object_library name)
+ parse_arguments(LIB "ARCH;SOURCES;CFLAGS" "" ${ARGN})
+ set(libname "${name}.osx")
+ add_library(${libname} OBJECT ${LIB_SOURCES})
+ set_target_compile_flags(${libname} ${LIB_CFLAGS})
+ set_target_properties(${libname} PROPERTIES
+ OSX_ARCHITECTURES "${LIB_ARCH}")
+endmacro()
+
# Adds static runtime for a given architecture and puts it in the proper
# directory in the build and install trees.
# add_compiler_rt_static_runtime(<name> <arch>