
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 llvm-svn: 240120
17 lines
626 B
CMake
17 lines
626 B
CMake
# Link a shared library with COMPILER_RT_TEST_COMPILER.
|
|
# 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)
|
|
cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN})
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
list(APPEND SOURCE_DEPS clang)
|
|
endif()
|
|
add_custom_command(
|
|
OUTPUT ${so_file}
|
|
COMMAND ${COMPILER_RT_TEST_COMPILER} -o "${so_file}" -shared
|
|
${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS}
|
|
DEPENDS ${SOURCE_DEPS})
|
|
endmacro()
|