summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/LLVMProcessSources.cmake
Commit message (Collapse)AuthorAgeFilesLines
* [llvm] [cmake] Add additional headers only if they existMichal Gorny2019-04-041-1/+9
| | | | | | | | | | | Modify the add_header_files_for_glob() function to only add files that do exist, rather than all matches of the glob. This fixes CMake error when one of the include directories (which happen to include /usr/include) contain broken symlinks. Differential Revision: https://reviews.llvm.org/D59632 llvm-svn: 357701
* [CMake] Unconditionally add .h and .td files to target sourcesChris Bieneman2018-10-111-9/+8
| | | | | | | | 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. llvm-svn: 344218
* Accept any filepath in llvm_check_source_file_listSerge Guelton2018-03-191-4/+14
| | | | | | | | | | | Cmake function llvm_check_source_file_list currently only accepts paths relative to current CMAKE_SOURCE_DIR or relative to argument SOURCE_DIR. Extend it to accept any path, including absolute ones. Differential revision: https://reviews.llvm.org/D44625 llvm-svn: 327912
* [CMake] Add LLVM_ENABLE_IDE option to better process sources for IDE'sEric Fiselier2018-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Currently LLVM has no way to support configuring for IDE's like CLion. Like XCode and MSVC's IDE, CLion needs to see all of the headers and tablegen files in order to properly parse the sources. This patch adds an `LLVM_ENABLE_IDE` option which can be used to configure for IDE's in general. It is used by `LLVMProcessSources.cmake` to determine if the extra source files should be added to the target. Unfortunately because of the low level of `LLVMProcessSources.cmake`, I'm not sure where the `LLVM_ENABLE_IDE` option should live. I choose `HandleLLVMOptions.cmake` so that out-of-tree Clang builds would correctly configure the option by default. Reviewers: beanz, mgorny, lebedev.ri Reviewed By: beanz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40219 llvm-svn: 322349
* [cmake] Add SOURCE_DIR argument to llvm_check_source_file_listShoaib Meenai2017-09-191-4/+16
| | | | | | | | | The motivation is to be able to check sources outside the current directory. See D31363 for example usage. Differential Revision: https://reviews.llvm.org/D37859 llvm-svn: 313648
* Teach llvm_add_library() to find include dirs.Zachary Turner2015-02-101-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since header files are not compilation units, CMake does not require you to specify them in the CMakeLists.txt file. As a result, unless a header file is explicitly added, CMake won't know about it, and when generating IDE-based projects, CMake won't put the header files into the IDE project. LLVM currently tries to deal with this in two ways: 1) It looks for all .h files that are in the project directory, and adds those. 2) llvm_add_library() understands the ADDITIONAL_HEADERS argument, which allows one to list an arbitrary list of headers. This patch takes things one step further. It adds the ability for llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which will specify a list of folders which CMake will glob for header files. Furthermore, it will glob not only for .h files, but also for .inc files. Included in this CL is an update to one of the existing users of ADDITIONAL_HEADERS to use this new argument instead, to serve as an illustration of how this cleans up the CMake. The big advantage of this new approach is that until now, there was no way for the IDE projects to locate the header files that are in the include tree. In other words, if you are in, for example, lib/DebugInfo/DWARF, the corresponding includes for this project will be located under include/llvm/DebugInfo/DWARF. Now, in the CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write: ADDITIONAL_HEADER_DIRS ../../include/llvm/DebugInfo/DWARF as an argument to llvm_add_library(), and all header files will get added to the IDE project. Differential Revision: http://reviews.llvm.org/D7460 Reviewed By: Chris Bieneman llvm-svn: 228670
* cmake: Don't reject unknown cpp files that start with .Matt Arsenault2014-09-021-4/+9
| | | | | | | | Some editors create hidden file backups in the same directory as the file, and it's annoying when cmake errors on them. llvm-svn: 216941
* [CMake] LLVMProcessSources.cmake: Prune add_file_dependencies to ↵NAKAMURA Takumi2014-02-101-8/+0
| | | | | | | | | ${TABLEGEN_OUTPUT}. I am sure it'd not be required any more. In trunk, all of tablegen's users depend on ${TABLEGEN_OUTPUT} as not file dependency but inter-target dependency. llvm-svn: 201063
* [CMake] Prune CMAKE_CXX_FLAGS stuff in llvm_process_sources.NAKAMURA Takumi2014-01-281-18/+0
| | | | | | It is the final step to deprecate contextual CMAKE_CXX_FLAGS. llvm-svn: 200303
* [CMake] Let llvm_process_sources check not only *.cpp but also *.c.NAKAMURA Takumi2014-01-281-2/+2
| | | | llvm-svn: 200298
* [CMake] LLVMProcessSources.cmake: Add include(CMakeParseArguments).NAKAMURA Takumi2014-01-201-0/+1
| | | | | | I didn't realize that cmake_parse_arguments() would require explicit inclusion. llvm-svn: 199674
* [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.NAKAMURA Takumi2014-01-201-2/+4
| | | | | | | | | | | | | | 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 ) llvm-svn: 199639
* CMake: Include private headers / tablegen files in generated Xcode projects.Jordan Rose2012-10-231-1/+1
| | | | llvm-svn: 166503
* LLVMProcessSources.cmake: [MSVC] Don't add "PROPERTIES HEADER_FILE_ONLY" to ↵NAKAMURA Takumi2012-06-241-1/+2
| | | | | | | *.def. FIXME: Shall we put *.def(s) to the folder? llvm-svn: 159102
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. llvm-svn: 158909
* Handle gcc-compatible compilers (such as clang) the same way we handleOscar Fuentes2011-05-111-2/+2
| | | | | | | | gcc. Fixes PR9886. llvm-svn: 131181
* Made llvm_replace_compiler_option more robust. Use it onOscar Fuentes2011-01-111-7/+14
| | | | | | llvm_process_sources. llvm-svn: 123232
* Don't use -O3 on Mingw, as people report it as unreliable. Use -O2Oscar Fuentes2011-01-071-0/+10
| | | | | | instead. llvm-svn: 123028
* LLVMProcessSources: add .def files along with .h files to targets forOscar Fuentes2011-01-031-1/+1
| | | | | | the benefit of project-based generators (VS, XCode, etc). llvm-svn: 122749
* Propagate to parent scope changes made to CMAKE_CXX_FLAGS.Oscar Fuentes2011-01-021-0/+1
| | | | llvm-svn: 122692
* CMake (MSVC): cmake automatically adds the /EHsc and /GR compilerOscar Fuentes2010-12-311-2/+2
| | | | | | | | | | options. If we are building with exceptions/rtti disabled, we replace /EHsc with /EHs-c- and /GR with /GR-, respectively. If we just add the disabling options we get warnings like this: cl : Command line warning D9025 : overriding '/EHs' with '/EHs-' llvm-svn: 122648
* Disable C++ exception handling on MSVC.Francois Pichet2010-12-041-0/+3
| | | | | | Total size of bin\Release on disk goes from 82.9 MB to 74.2 MB. (~10% saving) llvm-svn: 120908
* Disable RTTI on Windows. Francois Pichet2010-12-041-0/+2
| | | | | | Total size of bin\Release on disk goes from 83.6 MB to 81.8MB. (~2% saving) llvm-svn: 120901
* Build with RTTI and exceptions disabled. Only in GCC for now.Oscar Fuentes2010-10-171-0/+13
| | | | llvm-svn: 116682
* CMake: Report an error if there is an unknown .cpp file in a sourceOscar Fuentes2009-11-021-0/+15
| | | | | | | | | | | directory. This is useful in case someone who works with the config&make build system forgot to add a file to its CMakeLists.txt. Instead of obtaining undefined references at link time, cmake will complain at configure time on the first build after a svn update. llvm-svn: 85817
* CMake: Adds header and TableGen files to Visual Studio solution. A newOscar Fuentes2008-11-151-1/+27
| | | | | | | dummy library, `llvm_headers_do_not_build', is created for containing all header and TableGen files under include/llvm. llvm-svn: 59346
* CMake: Fixed dependencies of .cpp source files on .td and tablegennedOscar Fuentes2008-11-141-0/+13
files. llvm-svn: 59325
OpenPOWER on IntegriCloud