aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTLink.cmake
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2013-01-18 20:06:45 +0000
committerAndrew Turner <andrew@FreeBSD.org>2013-01-18 20:06:45 +0000
commit58aabf08b77d221489f10e274812ec60917c21a8 (patch)
treeb946f82269be87d83f086167c762c362e734c5bb /cmake/Modules/CompilerRTLink.cmake
parent37dfff057418e02f8e5322da12684dd927e3d881 (diff)
downloadsrc-58aabf08b77d221489f10e274812ec60917c21a8.tar.gz
src-58aabf08b77d221489f10e274812ec60917c21a8.zip
Import compiler-rt r172839.vendor/compiler-rt/compiler-rt-r172839
Notes
Notes: svn path=/vendor/compiler-rt/dist/; revision=245614 svn path=/vendor/compiler-rt/compiler-rt-r172839/; revision=245615; tag=vendor/compiler-rt/compiler-rt-r172839
Diffstat (limited to 'cmake/Modules/CompilerRTLink.cmake')
-rw-r--r--cmake/Modules/CompilerRTLink.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTLink.cmake b/cmake/Modules/CompilerRTLink.cmake
new file mode 100644
index 000000000000..85030a725e19
--- /dev/null
+++ b/cmake/Modules/CompilerRTLink.cmake
@@ -0,0 +1,14 @@
+include(LLVMParseArguments)
+
+# Link a shared library with just-built Clang.
+# clang_link_shared(<output.so>
+# OBJECTS <list of input objects>
+# LINKFLAGS <list of link flags>
+# DEPS <list of dependencies>)
+macro(clang_link_shared so_file)
+ parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN})
+ add_custom_command(
+ OUTPUT ${so_file}
+ COMMAND clang -o "${so_file}" -shared ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS}
+ DEPENDS clang ${SOURCE_DEPS})
+endmacro()