diff options
Diffstat (limited to 'cmake/Modules/CompilerRTLink.cmake')
| -rw-r--r-- | cmake/Modules/CompilerRTLink.cmake | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/cmake/Modules/CompilerRTLink.cmake b/cmake/Modules/CompilerRTLink.cmake new file mode 100644 index 0000000000000..85030a725e19b --- /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() | 
