Evgeniy Stepanov | 0231c50 | 2012-12-25 12:39:56 +0000 | [diff] [blame] | 1 | include(LLVMParseArguments) |
| 2 | |
| 3 | # Link a shared library with just-built Clang. |
| 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}) |
| 10 | add_custom_command( |
| 11 | OUTPUT ${so_file} |
| 12 | COMMAND clang -o "${so_file}" -shared ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} |
| 13 | DEPENDS clang ${SOURCE_DEPS}) |
| 14 | endmacro() |