1 # Link a shared library with COMPILER_RT_TEST_COMPILER. 2 # clang_link_shared(<output.so> 3 # OBJECTS <list of input objects> 4 # LINKFLAGS <list of link flags> 5 # DEPS <list of dependencies>) 6 macro(clang_link_shared so_file) 7 cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) 8 if(NOT COMPILER_RT_STANDALONE_BUILD) 9 list(APPEND SOURCE_DEPS clang) 10 endif() 11 add_custom_command( 12 OUTPUT ${so_file} 13 COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared 14 ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} 15 DEPENDS ${SOURCE_DEPS}) 16 endmacro() 17