Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 1 | include(LLVMParseArguments) |
| 2 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 3 | # Link a shared library with COMPILER_RT_TEST_COMPILER. |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 4 | # clang_link_shared(<output.so> |
| 5 | # OBJECTS <list of input objects> |
| 6 | # LINKFLAGS <list of link flags> |
| 7 | # DEPS <list of dependencies>) |
| 8 | macro(clang_link_shared so_file) |
| 9 | parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 10 | if(NOT COMPILER_RT_STANDALONE_BUILD) |
| 11 | list(APPEND SOURCE_DEPS clang) |
| 12 | endif() |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 13 | add_custom_command( |
| 14 | OUTPUT ${so_file} |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 15 | COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared |
| 16 | ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} |
| 17 | DEPENDS ${SOURCE_DEPS}) |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 18 | endmacro() |