llvm.org GIT mirror llvm / 6fb010f
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344218 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 1 year, 7 days ago
1 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
5151 cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
5252 set(sources ${ARG_UNPARSED_ARGUMENTS})
5353 llvm_check_source_file_list( ${sources} )
54 if( LLVM_ENABLE_IDE )
55 # This adds .td and .h files to the Visual Studio solution:
56 add_td_sources(sources)
57 find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
58 if (hdrs)
59 set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
60 endif()
61 set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
62 list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
54
55 # This adds .td and .h files to the Visual Studio solution:
56 add_td_sources(sources)
57 find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")
58 if (hdrs)
59 set_source_files_properties(${hdrs} PROPERTIES HEADER_FILE_ONLY ON)
6360 endif()
61 set_source_files_properties(${ARG_ADDITIONAL_HEADERS} PROPERTIES HEADER_FILE_ONLY ON)
62 list(APPEND sources ${ARG_ADDITIONAL_HEADERS} ${hdrs})
6463
6564 set( ${OUT_VAR} ${sources} PARENT_SCOPE )
6665 endfunction(llvm_process_sources)