Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | # Link a shared library with COMPILER_RT_TEST_COMPILER. |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 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) |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 7 | cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 8 | if(NOT COMPILER_RT_STANDALONE_BUILD) |
| 9 | list(APPEND SOURCE_DEPS clang) |
| 10 | endif() |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 11 | add_custom_command( |
| 12 | OUTPUT ${so_file} |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 13 | COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared |
| 14 | ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} |
| 15 | DEPENDS ${SOURCE_DEPS}) |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 16 | endmacro() |