summaryrefslogtreecommitdiff
path: root/cmake/modules/AddLLVM.cmake
Commit message (Collapse)AuthorAge
...
* Another windows build fix attempt after r198136.Nico Weber2013-12-29
| | | | | | | The current quoting is stripped by cmake, try quoting more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198143 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix windows build more after r198136.Nico Weber2013-12-29
| | | | | | | | | | The command that cmd.exe is complaining about is: cmd.exe /c cd /D C:\bb-win7\cmake-clang-i686-mingw32\build\tools\lto && cmake -E echo EXPORTS > symbol.def && type C:/bb-win7/cmake-clang-i686-mingw32/llvm-project/llvm/tools/lto/lto.exports >> symbol.def Maybe quoting the filename helps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198140 91177308-0d34-0410-b5e6-96231b3b80d8
* Use `${CMAKE_COMMAND}` instead of `cmake`.Nico Weber2013-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198139 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix windows build after r198136.Nico Weber2013-12-28
| | | | | | | `type` can't read from stdin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198138 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to fix linux build after r198136.Nico Weber2013-12-28
| | | | | | | $ needs to be written $$ in makefiles, but not in cmakefiles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198137 91177308-0d34-0410-b5e6-96231b3b80d8
* EXPORTED_SYMBOL_FILE support for cmakeNico Weber2013-12-28
| | | | | | | | | | | | | | The cmake build didn't support EXPORTED_SYMBOL_FILE. Instead, it had a Windows-only implementation in tools/lto/CMakeLists.txt, a linux-only implementation in tools/gold/CMakeLists.txt, and a darwin-only implementation in tools/clang/tools/libclang/CMakeLists.txt. This attempts to consolidate these one-offs into a single place. Clients can now just set LLVM_EXPORTED_SYMBOL_FILE and things (hopefully) Just Work, like in the make build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198136 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix documentation typosAlp Toker2013-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197757 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r197682, "[CMake] Introduce LIT in add_lit_target."NAKAMURA Takumi2013-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197703 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce LIT in add_lit_target.NAKAMURA Takumi2013-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197682 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce LLVM_RUNTIME_OUTPUT_INTDIR and LLVM_LIBRARY_OUTPUT_INTDIR ↵NAKAMURA Takumi2013-12-16
| | | | | | | | | | to reduce references to CMAKE_CFG_INTDIR. Each of them forms like; ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR} ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197394 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_lit_target: Let lit.site.cfg free from "--param build_mode" on ↵NAKAMURA Takumi2013-12-04
| | | | | | single configuration builds, like autoconf build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196377 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_lit_target: Tests should be excluded from "Build Solution".NAKAMURA Takumi2013-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196093 91177308-0d34-0410-b5e6-96231b3b80d8
* Translate ENABLE_CLANG_{ARCMT,REWRITER,STATIC_ANALYZER} when generatingRoman Divacky2013-08-27
| | | | | | | lit.site.cfg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189394 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Add LLVM_INSTALL_TOOLCHAIN_ONLY option.Hans Wennborg2013-08-24
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1428 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189155 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Automatically pick up subdirectories in llvm/tools as 'external ↵Argyrios Kyrtzidis2013-08-21
| | | | | | | | | projects' if they contain a 'CMakeLists.txt' file. Allow CMake to pick up external projects in llvm/tools without the need to modify the "llvm/tools/CMakeLists.txt" file. This makes it easier to work with projects that live in other repositories, without needing to specify each one in "llvm/tools/CMakeLists.txt". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188921 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_llvm_library: Specify explicit suffix .imp to import library to ↵NAKAMURA Takumi2013-08-14
| | | | | | | | avoid a warning between profile_rt-static and profile_rt-shared with lib/profile_rt.lib. FIXME: It seems MS version of profile_rt.dll doesn't contain any export symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188351 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing /GR with /GR- instead of applying both options to the project. ↵Aaron Ballman2013-08-06
| | | | | | This should reduce some build bot warnings (D9025: "overriding '/GR' with '/GR-'"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187836 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the executable bit on cmake filesSylvestre Ledru2013-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179976 91177308-0d34-0410-b5e6-96231b3b80d8
* Use correct host/target CMake variables to define lit variables.Tim Northover2013-02-14
| | | | | | | | | | | | | CMake and autotools disagree on what "host" means in a cross-compilation context. Autotools (and lit) take it to be the machine the binaries being compiled now will run on. CMake takes it to be the machine actually compiling the binaries now. This change makes lit.site-cfg more consistent between autotools and CMake, allowing lit tests (particularly in ExecutionEngine) to run correctly when cross-compiled with CMake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175179 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Lit][unittests] Cleanup in AddLLVM.cmake.NAKAMURA Takumi2013-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173617 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Lit][unittests] Deprecate CMAKE_BUILD_TYPE in each build directory ↵NAKAMURA Takumi2013-01-27
| | | | | | | | | | | | | | | | | | | | | | | | for unittests. For example, cur) unittests/ADT/Release/ADTTests new) unittests/ADT/ADTTests RUNTIME_BUILD_MODE can be substituted to CMAKE_CFG_INTDIR. With Make and Ninja, the tree is not built with multiple configurations. Then, including the build type in target directory doesn't make sense. See also "How can I build multiple modes without switching?" http://www.cmake.org/Wiki/CMake_FAQ CMAKE_CFG_INTDIR is set to "." With multiple-configuration-aware build system, like Visual Studio, each unittest is built on appropriate directory, for example, unittests/ADT/Release/ADTTests.exe CMAKE_CFG_INTDIR is set to build system's variable, like "$(Configuration)" or "$(OutDir)". Thus, "--param build_config" is also deprecated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173616 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] AddLLVM.cmake: Tweak the corner case that "check-all" doesn't have ↵NAKAMURA Takumi2012-12-24
| | | | | | | | | | | any tests. "check-all" can be executed with 0 status, "check-all does nothing, no tools built." LLVM_EXTERNAL_CLANG_BUILD=OFF LLVM_BUILD_TOOLS=OFF can reproduce this. Oscar Fuentes reported this. Thank you. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171046 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: factor out a function that returns the expected directory for unit testAlexey Samsonov2012-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170539 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_lit_testsuite: EXCLUDE_FROM_ALL excludes the test ${target} out ↵NAKAMURA Takumi2012-10-10
| | | | | | of check-all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165618 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Enhance add_llvm_external_project.NAKAMURA Takumi2012-10-05
| | | | | | | | | | | | - Substitute hyphen to underscore, s/-/_/g, as the variable name. - Additional parameter can be specified as the name of directory. e.g.) add_llvm_external_project(clang-tools-extra extra) - LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default. - Build directory is in ${CMAKE_CURRENT_BINARY_DIR}/extra git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165311 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_lit_target: Remove comments about add_dependencies. It is not a ↵NAKAMURA Takumi2012-08-04
| | | | | | bug in cmake that add_custom_target(DEPENDS) would not accept targets but file-level dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161295 91177308-0d34-0410-b5e6-96231b3b80d8
* detabifyGabor Greif2012-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160128 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r159588, and apply a more principled fix. Place the fix for thisChandler Carruth2012-07-02
| | | | | | | | | | | | in the abstraction for lit test suites so that the various other layers of abstraction pick up the same behavioral fix, and so that we still get a complete list of dependencies for the 'check-all' target. This should fix the follow-on issues of the same nature with various other build targets, including Clang targets. Sorry for the churn, and again thanks to Matt for testing and breaking this more thoroughly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159593 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch from using a lit.cfg-generator variable that happens to be foundChandler Carruth2012-07-02
| | | | | | | | | due to strange scoping rules to the actual canonical variable name within the LLVM CMake build. No functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159575 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist LLVM's lit testsuite infrastructure into module so that it can beChandler Carruth2012-06-30
| | | | | | | | | re-used. Also, build in direct support for accumulating a set of lit parameters, arguments, and testsuites to run as part of a 'check-all' rule. This sinks 'check-all' from a Clang-specific construct to a generic construct of the project. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159482 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing common variable to the lit.site.cfg generation. This wasChandler Carruth2012-06-29
| | | | | | only used in the Clang tree, but it seems reasonable to support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159399 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the setup for variables that are expanded in the lit.site.cfg intoChandler Carruth2012-06-28
| | | | | | | a dedicated helper function. This will enable re-using the same logic for Clang's lit setup, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159333 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid using the recently added APPEND_STRING feature. This shouldChandler Carruth2012-06-21
| | | | | | | restore support for CMake versions before 2.8.6 -- sorry for the trouble! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158930 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the logic for setting up a GoogleTest unit test executable intoChandler Carruth2012-06-21
| | | | | | | a helper function in CMake. This will allow us to share all of this logic with Clang, and eventually CompilerRT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158896 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one of the LLVM-specific CMake hacks in favor of standard CMakeChandler Carruth2012-06-21
| | | | | | | | | | facilities. This was only used in one place in LLVM, and was used pervasively (but with different code!) in Clang. It has no advantages over the standard CMake facilities and in some cases disadvantages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158889 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Restructure how Clang, Polly and other external projects get included.Michael J. Spencer2012-04-26
| | | | | | | | | | | | | | | | | | | While making lld build under the tools directory I decided to refactor how this works. There is now a macro, add_llvm_external_project, which takes the name of the expected subdirectory. This sets up two CMake options. * LLVM_EXTERNAL_${NAME}_SOURCE_DIR This is the path to the source. It defaults to ${CMAKE_CURRENT_SOURCE_DIR}/${name}. * LLVM_EXTERNAL_${NAME}_BUILD Enable and disable building the tool as part of LLVM. I chose LLVM_EXTERNAL_${NAME} as a prefix so they all show up together in the GUI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155654 91177308-0d34-0410-b5e6-96231b3b80d8
* build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar2011-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
* build/cmake: Switch to using llvm-build computed dependencies.Daniel Dunbar2011-11-29
| | | | | | | | - I verified locally that the current dependency lists are identical. - This makes add_llvm_library_dependencies() a no-op. I'll remove it once this change passes the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145355 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove yet another buried and hidden implicit dependency: every singleChandler Carruth2011-07-30
| | | | | | | | | | | | | sub-library for the targets depended on the core target CodeGen library. This completely undermined the careful work to separate the those libraries, especially the MC-layer ones. This surfaced as circular dependencies when the libraries were built as shared libraries where CMake doesn't allow cycles. This should fix PR10537. I'll watch the bots to see if there is fallout on other platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136565 91177308-0d34-0410-b5e6-96231b3b80d8
* Make my attempt to build up global deps variables actually utilizeChandler Carruth2011-07-29
| | | | | | | | globally scoped constructs. Also, round-trip these dependencies through the LLVMConfig.cmake.in file thata is used by CMake-based clients of "installed" (or built) LLVM trees. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136543 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
* 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
* While building a LLVM target, put the current source directory on theOscar Fuentes2011-07-25
| | | | | | header search path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135952 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
* Rename profile_rt.so to libprofile_rt.so under configure+make (it already wasNick Lewycky2011-04-29
| | | | | | | | | | | | | under cmake). Add libprofile_rt.a so that we can tell clang to link against it in --coverage mode. Also turn it on by default in cmake builds. Oscar, this touches a change you made for EXCLUDE_FROM_ALL support -- I think I've done the right thing, but please let me know (or fix and commit) if not! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130470 91177308-0d34-0410-b5e6-96231b3b80d8
* Honor LLVM_BUILD_RUNTIME.Oscar Fuentes2011-04-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130199 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename LLVMConfig.cmake to LLVM-Config.cmake. The *Config.cmake namingOscar Fuentes2011-04-05
| | | | | | scheme is used by the functionality related to find_package. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128889 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed the build of Clang's unit tests on MinGW. Also removed someOscar Fuentes2011-03-29
| | | | | | | | | | | unnecesary conditionals and introduced a new convenience function. The problem was that the list of libraries for Clang's unit tests was <clang libraries> <system libraries> <llvm libraries>. As the llvm libraries references symbols defined on the system libraries, those were reported as undefined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128484 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed workaround for unspecified build problem on MinGW.Oscar Fuentes2011-03-21
| | | | | | Tested that MinGW/MSYS builds fine without that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128033 91177308-0d34-0410-b5e6-96231b3b80d8