2012-12-25 20:39:56 +08:00
|
|
|
include(LLVMParseArguments)
|
|
|
|
|
2014-02-19 21:01:03 +08:00
|
|
|
# Link a shared library with COMPILER_RT_TEST_COMPILER.
|
2012-12-25 20:39:56 +08:00
|
|
|
# clang_link_shared(<output.so>
|
|
|
|
# OBJECTS <list of input objects>
|
|
|
|
# LINKFLAGS <list of link flags>
|
|
|
|
# DEPS <list of dependencies>)
|
|
|
|
macro(clang_link_shared so_file)
|
|
|
|
parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN})
|
2014-02-19 21:01:03 +08:00
|
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
list(APPEND SOURCE_DEPS clang)
|
|
|
|
endif()
|
2012-12-25 20:39:56 +08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${so_file}
|
2014-02-19 21:01:03 +08:00
|
|
|
COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared
|
|
|
|
${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS}
|
|
|
|
DEPENDS ${SOURCE_DEPS})
|
2012-12-25 20:39:56 +08:00
|
|
|
endmacro()
|