[llvm] r344218 - [CMake] Unconditionally add .h and .td files to target sources
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 10 21:02:53 PDT 2018
Author: cbieneman
Date: Wed Oct 10 21:02:53 2018
New Revision: 344218
URL: http://llvm.org/viewvc/llvm-project?rev=344218&view=rev
Log:
[CMake] Unconditionally add .h and .td files to target sources
Previously adding header and table gen files was conditional on using an IDE. Since these files have the `HEADER_FILE_ONLY` attribute applied they are ignored as sources by all non-IDE generators, so there is really no reason not to include them.
Additionally having the CMake always include these files allows the CMake-server to include them in the sources list for targets, which is valuable to anyone using CMake-server integrated tools.
Modified:
llvm/trunk/cmake/modules/LLVMProcessSources.cmake
Modified: llvm/trunk/cmake/modules/LLVMProcessSources.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMProcessSources.cmake?rev=344218&r1=344217&r2=344218&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMProcessSources.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMProcessSources.cmake Wed Oct 10 21:02:53 2018
@@ -52,16 +52,15 @@ function(llvm_process_sources OUT_VAR)
cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
set(sources ${ARG_UNPARSED_ARGUMENTS})
llvm_check_source_file_list( ${sources} )
- if( LLVM_ENABLE_IDE )
- # This adds .td and .h files to the Visual Studio solution:
- add_td_sources(sources)
- find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
- if (hdrs)
- set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
- endif()
- set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
- list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
+
+ # This adds .td and .h files to the Visual Studio solution:
+ add_td_sources(sources)
+ find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
+ if (hdrs)
+ set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
endif()
+ set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
+ list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
set( ${OUT_VAR} ${sources} PARENT_SCOPE )
endfunction(llvm_process_sources)
More information about the llvm-commits
mailing list