summaryrefslogtreecommitdiff
path: root/cmake/modules/TableGen.cmake
Commit message (Collapse)AuthorAge
* Clean up a pile of hacks in our CMake build relating to TableGen.Chandler Carruth2011-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first problem to fix is to stop creating synthetic *Table_gen targets next to all of the LLVM libraries. These had no real effect as CMake specifies that add_custom_command(OUTPUT ...) directives (what the 'tablegen(...)' stuff expands to) are implicitly added as dependencies to all the rules in that CMakeLists.txt. These synthetic rules started to cause problems as we started more and more heavily using tablegen files from *subdirectories* of the one where they were generated. Within those directories, the set of tablegen outputs was still available and so these synthetic rules added them as dependencies of those subdirectories. However, they were no longer properly associated with the custom command to generate them. Most of the time this "just worked" because something would get to the parent directory first, and run tablegen there. Once run, the files existed and the build proceeded happily. However, as more and more subdirectories have started using this, the probability of this failing to happen has increased. Recently with the MC refactorings, it became quite common for me when touching a large enough number of targets. To add insult to injury, several of the backends *tried* to fix this by adding explicit dependencies back to the parent directory's tablegen rules, but those dependencies didn't work as expected -- they weren't forming a linear chain, they were adding another thread in the race. This patch removes these synthetic rules completely, and adds a much simpler function to declare explicitly that a collection of tablegen'ed files are referenced by other libraries. From that, we can add explicit dependencies from the smaller libraries (such as every architectures Desc library) on this and correctly form a linear sequence. All of the backends are updated to use it, sometimes replacing the existing attempt at adding a dependency, sometimes adding a previously missing dependency edge. Please let me know if this causes any problems, but it fixes a rather persistent and problematic source of build flakiness on our end. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136023 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: generalize the system that creates custom targets forOscar Fuentes2011-07-25
| | | | | | tablegenning to all libraries and executables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135908 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the tablegenned files to the `clean' target.Oscar Fuentes2011-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124854 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes for building Clang and others using LLVM as an externalOscar Fuentes2011-02-03
| | | | | | | | | | | | | library. Installs tblgen (required by Clang). Translates handling of user settings and platform-dependant options to its own file, where it can included by another project. Installs the .cmake files required by projects like Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124816 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen.cmake: sometimes the .td file is not in the current directoryOscar Fuentes2011-01-03
| | | | | | | | | | | (clang/include/clang/Basic/StmtNodes.td, for instance, is tablegenned from clang/include/clang/AST/CMakeLists.txt) so it is not contained on the list of all .td files on the current source directory which is used as the DEPENDS of the custom command. We must add the .td file to the DEPENDS list of the custom command. Otherwise some .inc files are not regenerated when the corresponding .td file changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122768 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid stalled file dependency when tablegenning.Oscar Fuentes2010-10-22
| | | | | | Patch by Frits van Bommel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117113 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach CMake to only touch tablegen-generated files if anythingOscar Fuentes2010-10-22
| | | | | | | | actually changed. Patch by Frits van Bommel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117102 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow absolute paths in LLVM_TARGET_DEFINITIONS for CMake's TableGen ruleDouglas Gregor2010-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106219 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Don't use copy_if_different for TableGen output, because it does not ↵Douglas Gregor2009-08-22
| | | | | | work with IDE targets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79732 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: tablegen: Add .td files under the inlude/llvm directoryOscar Fuentes2009-07-13
| | | | | | | hierarchy to the list of dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75510 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing dependencies to the CMake build system.Douglas Gregor2009-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74161 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Fixed parallel build problem related to native tblgen whenOscar Fuentes2009-06-11
| | | | | | | cross-compiling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73180 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Make sure to build TableGen'd files in the binary directoryDouglas Gregor2009-03-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67052 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Do not rebuild the world when tblgen changes but the .inc filesOscar Fuentes2008-11-21
| | | | | | | it produces are not affected by the change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59763 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Use LLVM_MAIN_SRC_DIR instead of CMAKE_SOURCE_DIR, forOscar Fuentes2008-11-14
| | | | | | | | | consistency. Patch by Kevin Andre! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59326 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Fixed dependencies of .cpp source files on .td and tablegennedOscar Fuentes2008-11-14
| | | | | | | files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59325 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Support for cross-compiling. For now, requires a previouslyOscar Fuentes2008-11-09
| | | | | | | | | | | | | | built native tblgen which is passed to cmake in the variable LLVM_TABLEGEN. See http://www.cmake.org/Wiki/CmakeMingw for a quick example on how to cross-compile with CMake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58939 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Removed some cruft.Oscar Fuentes2008-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58358 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Builds all targets.Oscar Fuentes2008-09-26
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56641 91177308-0d34-0410-b5e6-96231b3b80d8