[llvm] r199639 - [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.

NAKAMURA Takumi geek4civic at gmail.com
Mon Jan 20 02:20:23 PST 2014


Author: chapuni
Date: Mon Jan 20 04:20:23 2014
New Revision: 199639

URL: http://llvm.org/viewvc/llvm-project?rev=199639&view=rev
Log:
[CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.

ADDITIONAL_HEADERS is intended to add header files for IDEs as hint.

For example:
  add_llvm_library(LLVMSupport
    Host.cpp
    ADDITIONAL_HEADERS
      Unix/Host.inc
      Windows/Host.inc
    )

Modified:
    llvm/trunk/cmake/modules/LLVMProcessSources.cmake
    llvm/trunk/lib/Support/CMakeLists.txt

Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=199639&r1=199638&r2=199639&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Mon Jan 20 04:20:23 2014
@@ -38,7 +38,8 @@ endmacro(add_header_files)
 
 
 function(llvm_process_sources OUT_VAR)
-  set( sources ${ARGN} )
+  cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS" ${ARGN})
+  set(sources ${ARG_UNPARSED_ARGUMENTS})
   llvm_check_source_file_list( ${sources} )
   # Create file dependencies on the tablegenned files, if any.  Seems
   # that this is not strictly needed, as dependencies of the .cpp
@@ -50,9 +51,10 @@ function(llvm_process_sources OUT_VAR)
   endforeach(s)
   if( MSVC_IDE OR XCODE )
     # This adds .td and .h files to the Visual Studio solution:
-    # FIXME: Shall we handle *.def here?
     add_td_sources(sources)
     add_header_files(sources)
+    set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
+    list(APPEND sources ${ARG_ADDITIONAL_HEADERS})
   endif()
 
   # Set common compiler options:

Modified: llvm/trunk/lib/Support/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CMakeLists.txt?rev=199639&r1=199638&r2=199639&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CMakeLists.txt (original)
+++ llvm/trunk/lib/Support/CMakeLists.txt Mon Jan 20 04:20:23 2014
@@ -89,6 +89,8 @@ add_llvm_library(LLVMSupport
   TimeValue.cpp
   Valgrind.cpp
   Watchdog.cpp
+
+  ADDITIONAL_HEADERS
   Unix/Host.inc
   Unix/Memory.inc
   Unix/Mutex.inc





More information about the llvm-commits mailing list