Alexey Samsonov | 17cf7c5 | 2014-02-19 13:01:03 +0000 | [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> |
Francis Ricci | 9f93113 | 2017-01-10 04:33:04 +0000 | [diff] [blame] | 4 | # LINK_FLAGS <list of link flags> |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 5 | # DEPS <list of dependencies>) |
| 6 | macro(clang_link_shared so_file) |
Francis Ricci | 9f93113 | 2017-01-10 04:33:04 +0000 | [diff] [blame] | 7 | cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINK_FLAGS;DEPS" ${ARGN}) |
Alexey Samsonov | 17cf7c5 | 2014-02-19 13:01:03 +0000 | [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} |
Alexey Samsonov | 17cf7c5 | 2014-02-19 13:01:03 +0000 | [diff] [blame] | 13 | COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared |
Francis Ricci | 9f93113 | 2017-01-10 04:33:04 +0000 | [diff] [blame] | 14 | ${SOURCE_LINK_FLAGS} ${SOURCE_OBJECTS} |
Alexey Samsonov | 17cf7c5 | 2014-02-19 13:01:03 +0000 | [diff] [blame] | 15 | DEPENDS ${SOURCE_DEPS}) |
Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 16 | endmacro() |