summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Disable rpath for UnitTestsJonas Hahnfeld2016-11-031-3/+5
| | | | | | | | This was broken since rL285714. Differential Revision: https://reviews.llvm.org/D26246 llvm-svn: 285881
* [CMake] Fix rpath construction for out-of-tree buildsChris Bieneman2016-11-011-0/+37
| | | | | | | | This patch was produced in conjunction with Michał Górny. It should resolve the issues that were trying to be solved by D25304. This moves rpath handling into `llvm_add_library` and `add_llvm_executable` so that it is available to all projects using AddLLVM whether built in-tree or out-of-tree. llvm-svn: 285714
* cmake: Enable the lto cache when building with -flto=thin on darwinJustin Bogner2016-10-281-0/+5
| | | | llvm-svn: 285450
* [cmake] Temporarily revert enforcement of minimum GCC version increaseTeresa Johnson2016-10-281-3/+5
| | | | | | | | | | | | | | | Summary: This is temporary, until bot that builds public facing LLVM documentation is upgraded. It reverts only the cmake change in r284497, but leaves the doc changes in place to preserve intent. Reviewers: aaron.ballman Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26078 llvm-svn: 285406
* cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTSJustin Bogner2016-10-241-2/+14
| | | | | | | Add a cmake-exports install component and appropriate targets for LLVM_DISTRIBUTION_COMPONENTS to work with. llvm-svn: 285030
* [docs] Increase minimum supported GCC version for building LLVM to 4.8Teresa Johnson2016-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | Summary: The RFC proposal sent to increase the minimum required GCC version to 4.8 received a lot of support. See the following thread: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105955.html, This patch implements that by updating the docs. I believe the references to libstdc++ 4.7 issues can be removed as well, please let me know if that is not the case or if they should be updated a different way. Reviewers: rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25683 llvm-svn: 284497
* [cmake] Make LIT_COMMAND configurable and improve fallback supportMichal Gorny2016-10-041-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make LIT_COMMAND configurable, use source tree only when actually available and extend the default search to other common executable names 'lit.py' and 'lit', in order to increase uniformity between all LLVM projects and support using installed lit. Changing the conditional used to determine whether in-tree or external lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but does not exist (anymore). In this case, the functions falls back to looking for installed lit rather than attempting to use a non-existing path. The same conditional is used in clang already. Making LIT_COMMAND a cache variable in case the source tree variant is used serves two purposes. Firstly, it increases uniformity between the two branches since find_program() implicitly makes LIT_COMMAND a cache variable. Secondly, it allows overriding the lit executable used to run the tests when the LLVM source tree is provided. Gentoo is planning to use this to use installed (and byte-compiled) lit instead of re-compiling it in every LLVM project. Extending default search is meant to increase uniformity between different LLVM projects. The 'lit.py' name is already used by a few of them, and 'lit' is the name used by utils/lit/setup.py when installing. Differential Revision: https://reviews.llvm.org/D25076 llvm-svn: 283247
* [CMake] Exclude intrinsics_gen from LLVM_COMMON_DEPENDS in LLVMConfig.cmakeChris Bieneman2016-10-041-0/+9
| | | | | | CMake requires that all targets expressed as dependencies exist, so we can't have intrinsics_gen in LLVM_COMMON_DEPENDS when it is written out, otherwise projects building out of tree will have CMake errors. llvm-svn: 283234
* [cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared librariesMichal Gorny2016-10-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reintroduce versioning of shared libraries via SOVERSION, addressing the issues with the previous design, since Gentoo is relying on shared-split install of LLVM. The SOVERSIONs were originally introduced in r229720 for all libraries, and removed in r252093 in favor of custom SONAME. As far as I understand, the major concern with the old versioning was that the used versions were incompatible with ldconfig. Having considered that, this commit introduce SOVERSIONS with the following considerations: 1. SOVERSIONs are formed of major & minor version concatenated -- i.e. for 4.0 its .so.40. This matches the common practice where the first version number indicates ABI breakage, and therefore fixes the issues with ldconfig. Additionally, VERSION with the remaining verion components appended is used, however this is not strictly necessary. 2. The versioning is only applied to libraries with no explicit SONAME specified -- i.e. it won't apply to libLLVM but only to the split libraries. It will also apply to libraries installed by the subprojects. 3. The versioning is only done on *nix systems, Darwin excluded. This matches the current use of SONAME. Differential Revision: https://reviews.llvm.org/D24757 llvm-svn: 283189
* [cmake] Use separate doctrees to prevent races between Sphinx instancesMichal Gorny2016-10-041-1/+1
| | | | | | | | | | | | Use separate doctrees between different Sphinx builders in order to prevent race condition issues due to multiple Sphinx instances accessing the same doctree cache in parallel. Bug: https://llvm.org/bugs/show_bug.cgi?id=23781 Differential Revision: https://reviews.llvm.org/D23755 llvm-svn: 283188
* Revert r283029 - [cmake] Make LIT_COMMAND configurable and improve fallback ↵Michal Gorny2016-10-011-4/+3
| | | | | | | | | | | | | | support Revert the change in r283029 (and the fixup in r283033) due to buildbot breakage. The fixup is ineffective for the bots that do not force clean build since the wrong value is already cached in CMakeCache.txt. Reverting it should result in the cache variable being removed and therefore it should be possible to re-introduce it after all buildbots build this revision. llvm-svn: 283036
* [cmake] Fix incorrect default for LIT_COMMAND, from r283029Michal Gorny2016-10-011-1/+1
| | | | llvm-svn: 283033
* [cmake] Make LIT_COMMAND configurable and improve fallback supportMichal Gorny2016-10-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make LIT_COMMAND configurable, use source tree only when actually available and extend the default search to other common executable names 'lit.py' and 'lit', in order to increase uniformity between all LLVM projects and support using installed lit. Changing the conditional used to determine whether in-tree or external lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but does not exist (anymore). In this case, the functions falls back to looking for installed lit rather than attempting to use a non-existing path. The same conditional is used in clang already. Making LIT_COMMAND a cache variable in case the source tree variant is used serves two purposes. Firstly, it increases uniformity between the two branches since find_program() implicitly makes LIT_COMMAND a cache variable. Secondly, it allows overriding the lit executable used to run the tests when the LLVM source tree is provided. Gentoo is planning to use this to use installed (and byte-compiled) lit instead of re-compiling it in every LLVM project. Extending default search is meant to increase uniformity between different LLVM projects. The 'lit.py' name is already used by a few of them, and 'lit' is the name used by utils/lit/setup.py when installing. Differential Revision: https://reviews.llvm.org/D25076 llvm-svn: 283029
* [OCaml] Install .mli (interface) filesMichal Gorny2016-10-011-1/+2
| | | | | | | | | | | | | Install the OCaml interface .mli files. Those files were most likely omitted because they are input files for the compiled .cmi files. However, installing them is reasonable since -- unlike .cmi files -- they are human-readable. The issue was originally spotted by @jpdeplaix. Differential Revision: https://reviews.llvm.org/D25128 llvm-svn: 283028
* cmake: Install the OCaml libraries into a more correct pathMichal Gorny2016-09-301-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a OCAML_INSTALL_PATH variable that can be used to control the install path for OCaml libraries. The new variable defaults to ${OCAML_STDLIB_PATH}, i.e. the OCaml library path obtained from the OCaml compiler. Install libraries into "llvm" subdirectory. This fixes two issues: 1. OCaml library directories differ between systems, and 'lib/ocaml' is incorrect e.g. on amd64 Gentoo where OCaml is installed in 'lib64/ocaml'. Therefore, obtain the library path from the OCaml compiler using 'ocamlc -where' (which is already used to set OCAML_STDLIB_PATH), which is the method used commonly in OCaml packages. 2. The top-level directory is reserved for the standard library, and has precedence over local directory in search path. As a result, OCaml preferred the files installed along with previous LLVM version over the source tree when building a new version, resulting in two versions being mixed during the build. The new layout is used commonly by other OCaml packages, and findlib is able to find the LLVM libraries successfully. Bug: https://bugs.gentoo.org/559134 Bug: https://bugs.gentoo.org/559624 Differential Revision: https://reviews.llvm.org/D24354 llvm-svn: 282895
* [CMake] Support symlinks even with LLVM_INSTALL_TOOLCHAIN_ONLYPetr Hosek2016-09-301-3/+3
| | | | | | | | | | When LLVM_INSTALL_TOOLCHAIN_ONLY is used and LLVM_TOOLCHAIN_TOOLS contains a tool which is a symlink, it would be ignored. This already worked before but got broken in r282510. Differential Revision: https://reviews.llvm.org/D25067 llvm-svn: 282844
* [modules] Centralize the module cache.Vassil Vassilev2016-09-291-1/+1
| | | | | | This reduces the build size from 17G to 1.9G on my machine. llvm-svn: 282704
* Improve CMake output of host and target tripleChris Bieneman2016-09-271-1/+0
| | | | | | | | | | | | | | | | | Summary: The previous output was confusing as it would output "Taget triple: x86_64-unknown-linux-gnu" even when LLVM_HOST_TRIPLE or LLVM_DEFAULT_TARGET_TRIPLE were set on the CMake command line Patch by: Alex Richardson! Reviewers: beanz Subscribers: Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D17067 llvm-svn: 282516
* [CMake] Use if(... IN_LIST ...) instead of list(FIND...)Chris Bieneman2016-09-271-14/+6
| | | | | | NFC. This is just a little code cleanup to make things easier to read and understand. llvm-svn: 282510
* cmake: Support overriding Sphinx HTML doc install directoryMichal Gorny2016-09-231-2/+9
| | | | | | | | | | | | Provide ${PROJECT}_INSTALL_SPHINX_HTML_DIR variables (e.g. LLVM_INSTALL_SPHINX_HTML_DIR) to override Sphinx HTML doc install directory. Bug: https://llvm.org/bugs/show_bug.cgi?id=23780 Differential Revision: https://reviews.llvm.org/D23757 llvm-svn: 282240
* [CMake] Support symlinks with the same name as the binaryChris Bieneman2016-09-161-2/+8
| | | | | | | | This supports creating symlinks to tools in different directories than the tool is built to. This is useful for the LLDB framework build which I’m sending patches for shortly. llvm-svn: 281788
* Install libLLVM if needed with LLVM_INSTALL_TOOLCHAIN_ONLYDerek Schuff2016-09-161-1/+2
| | | | | | | | | | | | | | Summary: When LLVM_LINK_LLVM_DYLIB is set, the libLLVM shared library needs to be installed in the toolchain. Without this chanage LLVM_INSTALL_TOOLCHAIN_ONLY combined with LLVM_LINK_LLVM_DYLIB results in a broken install. Patch by Sam Clegg Differential Revision: https://reviews.llvm.org/D24676 llvm-svn: 281763
* [cmake] Fix a stale comment from an earlier version of r281085. NFC.Michael Gottesman2016-09-091-2/+1
| | | | llvm-svn: 281086
* [cmake] Export gtest/gtest_main and its dependencies via a special build ↵Michael Gottesman2016-09-093-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tree only cmake exports file. Previously, gtest/gtest_main were not exported via cmake. The intention here was to ensure that users whom are linking against the LLVM install tree would not get the gtest/gtest_main targets. This prevents downstream projects that link against the LLVM build tree (i.e. Swift) from getting this dependency information in their cmake builds. Without such dependency information, linker issues can result on linux due to LLVMSupport being put before gtest on the linker command line. This commit preserves behavior that we want for the install tree, while adding support for the build tree by: 1. The special casing for gtest/gtest_main in the add_llvm_library code is removed in favor of a flag called "BUILDTREE_ONLY". If this is set, then the library is communicating that it is only meant to be exported into the build tree and is not meant to be installed or exported via the install tree. This part is just a tweak to remove the special case, the underlying code is the same. 2. The cmake code that exports cmake targets for the build tree has special code to import an additional targets file called LLVMBuildTreeOnlyExports.cmake. Additionally the extra targets are added to the LLVMConfig.cmake's LLVM_EXPORTED_TARGETS variable. In contrast, the "installation" cmake file uses the normal LLVM_EXPORTS_TARGETS as before and does not include the extra exports file. This is implemented by defining/undefining variables when performing a configure of the build/install tree LLVMConfig.cmake files. llvm-svn: 281085
* Move the ocaml_all target into the Misc folder for cleanliness; NFC.Aaron Ballman2016-09-091-0/+1
| | | | llvm-svn: 281061
* [CMake] Cleanup LLVM_OPTIMIZED_TABLEGENChris Bieneman2016-09-062-14/+21
| | | | | | | | | | This cleanup removes the need for the native support library to have its own target. That target was only needed because makefile builds were tripping over each other if two tablegen targets were building at the same time. This causes problems because the parallel make invocations through CMake can't communicate with each other. This is fixed by invoking make directly instead of through CMake which is how we handle this in External Project invocations. The other part of the cleanup is to mark the custom commands as USES_TERMINAL. This is a bit of a hack, but we need to ensure that Ninja generators don't invoke multiple tablegen targets in the same build dir in parallel, because that too would be bad. Marking as USES_TERMINAL does have some downside for Ninja because it results in decreased parallelism, but correct builds are worth the minor loss and LLVM_OPTIMZIED_TABLEGEN is such a huge win, it is worth it. llvm-svn: 280748
* [CMake] [OCaml] Allow building OCaml bindings out of tree.Peter Zotov2016-09-051-3/+9
| | | | | | | | | That is, add build system support for building the OCaml bindings against preinstalled LLVM libraries. This is important for package managers such as OPAM, because OCaml libraries need to be built against a specific OCaml compiler installation. llvm-svn: 280642
* [CMake] Revive LLVM_*_DIRS variablesChris Bieneman2016-09-011-0/+7
| | | | | | | | This is a partial revert of r280013. Brad King pointed out these variable names are matching CMake conventions, so we should preserve them. I've also added a direct mapping of the LLVM_*_DIR variables which we need to make projects support building in and out of tree. llvm-svn: 280380
* [CMake] Fix LLVM_ENABLE_EH and LLVM_ENABLE_RTTI on MSVCAndrey Bokhanko2016-09-011-0/+5
| | | | | | | | Patch by Johannes Sebastian Mueller-Roemer. Differential Revision: https://reviews.llvm.org/D23645 llvm-svn: 280371
* [CMake] Increase stack size to 16MiB for all mingw executables.NAKAMURA Takumi2016-08-312-12/+11
| | | | llvm-svn: 280303
* [CMake] Make LLVMConfig.cmake variable names match in-tree namesChris Bieneman2016-08-291-2/+1
| | | | | | | | | | | | With the runtimes build we're trying to use LLVMConfig.cmake as a way of providing LLVM_* variables that are needed to behave as if the project is building in tree. To make this work we need to rename two variables by dropping the "S" from the end. This makes the variables match the in-tree names. This renames: LLVM_INCLUDE_DIRS -> LLVM_INCLUDE_DIR LLVM_LIBRARY_DIRS -> LLVM_LIBRARY_DIR The versions ending in S are not used in-tree anywhere. This also cleans up LLVM_LIBRARY_DIR being set to the same value with and without the "S". llvm-svn: 280013
* cmake: Install CheckAtomic.cmake (needed by lldb)Chris Bieneman2016-08-251-2/+1
| | | | | | | | | | | | | | | Summary: Install CheckAtomic.cmake along with other LLVM modules, therefore making it possible for other projects to use it. This file is needed for LLDB to be built standalone, and installing it was suggested in https://reviews.llvm.org/D23881. Patch by: Michał Górny Reviewers: krytarowski, zturner, eugenis, jyknight, labath, beanz Subscribers: beanz, llvm-commits Differential Revision: https://reviews.llvm.org/D23887 llvm-svn: 279777
* [CMake] Make llvm-config implicit dependency for subprojectsChris Bieneman2016-08-181-1/+1
| | | | | | | | The subproject interface being used for runtime libraries expects that llvm-config is passed into the subproject for consumption. We currently do this for every subproject, so we should expect that all LLVM ExternalProjects depend on llvm-config for the time being. Eventually I'd like to see the sub-projects using LLVMConfig.cmake instead of the llvm-config binary, but that will take time to roll out. llvm-svn: 279155
* Remove LLVM_ENABLE_LIBCXXABIJonas Hahnfeld2016-08-041-5/+0
| | | | | | | | libc++.so is now a linker script that includes -lc++abi if necessary. Differential Revision: https://reviews.llvm.org/D22861 llvm-svn: 277714
* Add LLVM_ENABLE_LLD option to use LLD as C/C++ linker.Eugene Zelenko2016-07-291-0/+6
| | | | | | Differential revision: https://reviews.llvm.org/D22896 llvm-svn: 277093
* [llvm-go] parameterize $GOPATH constructionAndrew Wilkins2016-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: To build llgo, you must currently ensure that llgo is in the tools/llgo directory, due to a hard-coded path in llvm-go. To support the use of LLVM_EXTERNAL_LLGO_SOURCE_DIR, we introduce a flag to llvm-go that enables the caller to specify the paths to symlink in the temporary $GOPATH. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D21634 llvm-svn: 276829
* cmake: When adding lit testsuites, ignore Output directoriesJustin Bogner2016-07-251-1/+2
| | | | | | | | | With in-tree builds we can get Output directories scattered among our tests. Recursing into those to find tests doesn't make sense. Thanks to nlewycky for noticing this! llvm-svn: 276667
* Add AIX support to Path.inc, Host.h, and CMake.Chandler Carruth2016-07-192-4/+7
| | | | | | | | Patch by Andrew Paprocki! Differential Revision: https://reviews.llvm.org/D18359 llvm-svn: 276045
* [cmake] Create the LLVM_BUILD_UTILS option.Michael Gottesman2016-07-101-2/+7
| | | | | | | | | | | | | | | This option is the equivalent option to LLVM_BUILD_TOOLS but for executables created via add_llvm_utility. This is a useful tool for improving compile time in situations where LLVM is used as a library and no testing tools are needed. It follows the exact same implemention model as LLVM_BUILD_TOOLS. Since the option is by default set to on, no behavior is changed unless one sets it from the command line to be false. llvm-svn: 275007
* [CMake] Adjust export_executable_symbols to cope with non-target link librariesJohn Brawn2016-07-051-13/+15
| | | | | | | | | export_executable_symbols looks though the link libraries of the executable in order to figure out transitive dependencies, but in doing so it assumes that all link libraries are also targets. This is not true as of r273302, so adjust it to check if they actually are targets. llvm-svn: 274546
* [CMake] Add LLVM_BUILD_32_BITS to LLVMConfig.cmakeJohn Brawn2016-07-011-0/+2
| | | | | | | | | | | Previously out-of-tree passes could detect if LLVM was built with LLVM_BUILD_32_BITS by looking for -m32 in LLVM_DEFINITIONS, but as of r271871 it no longer appears there. Resolve this by instead emitting LLVM_BUILD_32_BITS in LLVMConfig so it can be checked for directly. Differential Revision: http://reviews.llvm.org/D21434 llvm-svn: 274351
* [CMake] Add an LLVM_ENABLE_MODULE_DEBUGGING flag for building with -gmodules.Adrian Prantl2016-06-301-0/+5
| | | | | | | | | This flag is only effective in builds with debug info and modules. The default is On for Darwin only. rdar://problem/27019000 llvm-svn: 274244
* Revert "[CMake] Move the -Xclang option before -fmodules-cache-path"Adrian Prantl2016-06-301-2/+2
| | | | | | | | | This reverts commit 3db82f646a0890eb7664d0351b5a3c79622e8bef. Vassil already fixed this and I mechanically undid his fix without looking too close at what I'm actually doing. Need more coffee. llvm-svn: 274242
* [CMake] Move the -Xclang option before -fmodules-cache-pathAdrian Prantl2016-06-301-2/+2
| | | | | | | | | | This fixes a typo introduced in r274196. Thanks to Vassil Vassilev for noticing! http://reviews.llvm.org/D21827 rdar://problem/27019000 llvm-svn: 274240
* [CMake] -fmodules-local-submodule-visibility is a cc1-only option.Vassil Vassilev2016-06-301-2/+2
| | | | | | This should fix modules builds on platforms other than Darwin after r274196. llvm-svn: 274227
* [CMake] Introduce a LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY flag.Adrian Prantl2016-06-301-2/+11
| | | | | | | | | | | | | On Darwin it is currently impossible to build LLVM with modules because the Darwin system module map is not compatible with -fmodules-local-submodule-visibility at this point in time. This patch makes the flag optional and off by default on Darwin so it becomes possible to build LLVM with modules again. http://reviews.llvm.org/D21827 rdar://problem/27019000 llvm-svn: 274196
* [LLVMConfig.cmake] LLVM_CONFIG_EXPORTED_TARGETS => LLVM_EXPORTED_TARGETS.Michael Gottesman2016-06-291-1/+1
| | | | | | | This matches more closely the rest of the variables in LLVMConfig.cmake which shed the _CONFIG_ part of their names. llvm-svn: 274175
* [LLVMConfig.cmake.in] Create a new variable LLVM_CONFIG_EXPORTED_TARGETS ↵Michael Gottesman2016-06-291-0/+1
| | | | | | that contains the list of all targets exported via LLVMExports.cmake. llvm-svn: 274140
* [cmake] Port the llvm-config option --build-mode to LLVMConfig.cmake via the ↵Michael Gottesman2016-06-251-0/+2
| | | | | | | | | | | | variable LLVM_BUILD_TYPE. This is just a small step in the direction of making LLVMConfig.cmake a complete replacement for llvm-config. For those unfamiliar, llvm-config --build-mode prints out CMAKE_BUILD_TYPE. Thus as one can imagine, LLVM_BUILD_TYPE is @CMAKE_BUILD_TYPE@. llvm-svn: 273782
* [CMake] Add LLVM runtimes directoryChris Bieneman2016-06-231-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are a few LLVM projects that produce runtime libraries. Ideally runtime libraries should be built differently than other projects, specifically they should be built using the just-built toolchain. There is support for building compiler-rt in this way from the clang build. Moving this logic into the LLVM build is interesting because it provides a simpler way to extend the just-built toolchain to include LLD and the LLVM object file tools. Once this functionality is better fleshed out and tested we’ll want to encapsulate it in a module that can be used for clang standalone builds, and we’ll want to make it the default way to build compiler-rt. With this patch applied there is no immediate change in the build. Moving compiler-rt out from llvm/projects into llvm/runtimes enables the functionality. This code has a few improvements over the method provided by LLVM_BUILD_EXTERNAL_COMPILER_RT. Specifically the sub-ninja command is always invoked, so changes to compiler-rt source files will get built properly, so this patch can be used for iterative development with just-built tools. This first patch only works with compiler-rt. Support for other runtime projects will be coming in follow-up patches. Reviewers: chandlerc, bogner Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D20992 llvm-svn: 273620
OpenPOWER on IntegriCloud