[CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HEADERS to pass through to process_source.

I was insightless then about unknown optional parameters.
(Consider that LINK_LIBS foo bar ADDITIONAL_HEADERS qux quux)

Suggested by Michael Kruse. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2014-02-13 01:00:52 +00:00
parent 81c7e1871f
commit 571417b8a3

View File

@ -174,17 +174,21 @@ endfunction()
# Same as the variable LLVM_LINK_COMPONENTS.
# LINK_LIBS lib_targets...
# Same semantics as target_link_libraries().
# ADDITIONAL_HEADERS (implemented in LLVMProcessSources)
# ADDITIONAL_HEADERS
# May specify header files for IDE generators.
# )
function(llvm_add_library name)
cmake_parse_arguments(ARG
"MODULE;SHARED;STATIC"
"OUTPUT_NAME"
"DEPENDS;LINK_COMPONENTS;LINK_LIBS"
"ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS"
${ARGN})
list(APPEND LLVM_COMMON_DEPENDS ${ARG_DEPENDS})
llvm_process_sources(ALL_FILES ${ARG_UNPARSED_ARGUMENTS})
if(ARG_ADDITIONAL_HEADERS)
# Pass through ADDITIONAL_HEADERS.
set(ARG_ADDITIONAL_HEADERS ADDITIONAL_HEADERS ${ARG_ADDITIONAL_HEADERS})
endif()
llvm_process_sources(ALL_FILES ${ARG_UNPARSED_ARGUMENTS} ${ARG_ADDITIONAL_HEADERS})
if(ARG_MODULE)
if(ARG_SHARED OR ARG_STATIC)