[CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HEADERS to pass...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 13 Feb 2014 01:00:52 +0000 (01:00 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 13 Feb 2014 01:00:52 +0000 (01:00 +0000)
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

cmake/modules/AddLLVM.cmake

index 59add8d..a253e13 100644 (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)