Skip to content

Commit

Permalink
[CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HE…
Browse files Browse the repository at this point in the history
…ADERS 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
  • Loading branch information
chapuni committed Feb 13, 2014
1 parent 81c7e18 commit 571417b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 571417b

Please sign in to comment.