summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Avoid REVERSE on unset variableSven van Haastregt2018-09-261-1/+3
| | | | | | | | | | | | | | If required_libs happens to remain unset, CMake would fail with: list sub-command REVERSE requires list to be present. Fix by ensuring we do not attempt to reverse an unset variable. Reported by Tu Vuong. Differential Revision: https://reviews.llvm.org/D51799 llvm-svn: 343088
* Move individual benchmark targets into the Utils folder in IDEs.Aaron Ballman2018-09-211-0/+1
| | | | llvm-svn: 342785
* Test commit accessLion Yang2018-09-141-1/+1
| | | | | | Remove trailing spaces llvm-svn: 342268
* Introduce explicit add_unittest_with_input_files target for tests that use ↵Nico Weber2018-09-141-5/+10
| | | | | | | | | | | llvm::getInputFileDirectory() Using llvm::getInputFileDirectory() in unit tests is discouraged, so require an explicit opt-in. This way, cmake also writes ~60 fewer unused files to disk. Differential Revision: https://reviews.llvm.org/D52095 llvm-svn: 342248
* [CMake] Fix LLVM_ENABLE_LTO option on WindowsAlexandre Ganea2018-09-071-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D51804 llvm-svn: 341701
* Fix a configure issue with Visual Studio generators.Zachary Turner2018-09-061-1/+1
| | | | | | | | | | | | | We can't put the unittest source dir map in the configuration specific directory because VS doesn't have a configure-specific directory, instead it only knows this at runtime. So we have to remove this from the path. This in turn means that the path will be slightly different in VS configurations vs non vs configurations. In the former, the source map will be in the parent directory of the executable, and in the latter it will be in the same directory as the executable. So check both. llvm-svn: 341590
* Add support for unittest inputs.Zachary Turner2018-09-051-0/+6
| | | | | | | | | | | | | | | | | | | | | Occasionally it is useful to have unittest which take inputs. While we normally try to have this test be more of a lit test we occasionally don't have tools that can exercise the code in the right way to test certain things. LLDB has been using this style of unit test for a while, particularly with regards to how it tests core dump and minidump file parsing. Recently i needed this as well for the case where we want to test that some of the PDB reading code works correctly. It needs to exercise the code in a way that is not covered by any dumper and would be impractical to implement in one of the dumpers, but requires a valid PDB file. Since this is now needed by more than one project, it makes sense to have this be a generally supported thing that unit tests can do, and we just encourage people to use this sparingly. Differential Revision: https://reviews.llvm.org/D51561 llvm-svn: 341502
* Disable -Wnoexcept-type due to false positives with GCC.Aaron Ballman2018-09-041-0/+4
| | | | | | GCC triggers false positives if a nothrow function is called through a template argument. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80985 for details. The LLVM libraries have no stable C++ API, so the warning is not useful. llvm-svn: 341361
* Remove LIT_SITE_CFG_IN_FOOTER, llvmNico Weber2018-08-301-4/+0
| | | | | | | | | | It's always replaced with the same (short) static string, so just put that there directly. No intended behavior change. https://reviews.llvm.org/D51357 llvm-svn: 341135
* Revert "[CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES"Roman Lebedev2018-08-302-7/+7
| | | | | | | | | | | | That resulted in the check-llvm-* targets not being avaliable in the QtCreator-configured build directories. Moreover, that was a clearly non-NFC change, and i can't find any review for it. This reverts commit rL340435. llvm-svn: 341045
* Pull google/benchmark library to the LLVM treeKirill Bobyrev2018-08-281-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch pulls google/benchmark v1.4.1 into the LLVM tree so that any project could use it for benchmark generation. A dummy benchmark is added to `llvm/benchmarks/DummyYAML.cpp` to validate the correctness of the build process. The current version does not utilize LLVM LNT and LLVM CMake infrastructure, but that might be sufficient for most users. Two introduced CMake variables: * `LLVM_INCLUDE_BENCHMARKS` (`ON` by default) generates benchmark targets * `LLVM_BUILD_BENCHMARKS` (`OFF` by default) adds generated benchmark targets to the list of default LLVM targets (i.e. if `ON` benchmarks will be built upon standard build invocation, e.g. `ninja` or `make` with no specific targets) List of modifications: * `BENCHMARK_ENABLE_TESTING` is disabled * `BENCHMARK_ENABLE_EXCEPTIONS` is disabled * `BENCHMARK_ENABLE_INSTALL` is disabled * `BENCHMARK_ENABLE_GTEST_TESTS` is disabled * `BENCHMARK_DOWNLOAD_DEPENDENCIES` is disabled Original discussion can be found here: http://lists.llvm.org/pipermail/llvm-dev/2018-August/125023.html Reviewed by: dberris, lebedev.ri Subscribers: ilya-biryukov, ioeric, EricWF, lebedev.ri, srhines, dschuff, mgorny, krytarowski, fedor.sergeev, mgrang, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D50894 llvm-svn: 340809
* [CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPESChris Bieneman2018-08-222-7/+7
| | | | | | | | | | There are several places where we use CMAKE_CONFIGURATION_TYPES to determine if we are using an IDE generator and in turn decide not to generate some of the convenience targets (like all the install-* and check-llvm-* targets). This decision is made because IDEs don't always deal well with the thousands of targets LLVM can generate. This approach does not work for Visual Studio 15's new CMake integration. Because VS15 uses a Ninja generator, it isn't a multi-configuration build, and generating all these extra targets mucks up the UI and adds little value. With this change we still don't generate these targets by default for Visual Studio and Xcode generators, and LLVM_ENABLE_IDE becomes a switch that can be enabled on the VS15 CMake builds, to improve the IDE experience. llvm-svn: 340435
* [cmake] Prevent LLVMgold.so from being unloaded on LinuxHans Wennborg2018-08-161-0/+1
| | | | | | | | | | | | | Extend the fix from D40459 to also apply to modules such as the LLVM gold plugin. This is needed because current binutils master (and future binutils 2.32) calls dlclose() on bfd plugins as part of a recent fix for https://sourceware.org/bugzilla/show_bug.cgi?id=23460. Patch by Evangelos Foutras! Differential Revision: https://reviews.llvm.org/D50416 llvm-svn: 339883
* [CMake] Split -gx strip flag into -g -xPetr Hosek2018-08-141-1/+1
| | | | | | | | | llvm-strip doesn't handle -gx spelling, so we need to split these as two separate flags. Differential Revision: https://reviews.llvm.org/D50684 llvm-svn: 339639
* [CMake] Use normalized Windows target triplesPetr Hosek2018-08-091-4/+4
| | | | | | | | | | | Changes the default Windows target triple returned by GetHostTriple.cmake from the old environment names (which we wanted to move away from) to newer, normalized ones. This also requires updating all tests to use the new systems names in constraints. Differential Revision: https://reviews.llvm.org/D47381 llvm-svn: 339307
* [cmake] Append LLVM_VERSION_SUFFIX to SOVERSIONMichal Gorny2018-08-081-1/+1
| | | | | | | | | | | | | | | | | Append LLVM_VERSION_SUFFIX to SOVERSION. This makes it possible to use the suffix to differentiate binary-incompatible versions of LLVM built via BUILD_SHARED_LIBS. We are planning to use this to temporarily preserve ABI-incompatible variants of LLVM while switching the system between them, e.g. when rebuilding the system to use libc++. Normally this would mean that once LLVM is rebuilt using libc++ all the reverse dependencies become immediately broken. Using a distinct SOVERSION allows us to preserve the ABI compatibility before all the packages are rebuilt. Differential Revision: https://reviews.llvm.org/D39939 llvm-svn: 339286
* cmake: Store LLVM_VERSION_SUFFIX in LLVMConfig.cmakeMichal Gorny2018-08-081-0/+1
| | | | | | | | | | | | | | | | Store LLVM_VERSION_SUFFIX along with other version components in LLVMConfig.cmake. This fixes preserving the suffix set while building LLVM to stand-alone builds of other components, e.g. clang, and therefore improves uniformity between the two build models. Given that there is no apparent reason to omit this part of version, that it is distributed to subprojects when building as part of LLVM and that it is included in LLVM_PACKAGE_VERSION, I think it was omitted accidentally rather than done on purpose. Differential Revision: https://reviews.llvm.org/D43701 llvm-svn: 339285
* Add llvm-rc to LLVM_TOOLCHAIN_TOOLS (PR38386)Hans Wennborg2018-08-011-0/+1
| | | | | | | This means it will be installed also in builds configured with LLVM_INSTALL_TOOLCHAIN_ONLY, such as the Windows packages. llvm-svn: 338495
* [CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ONPhilip Pfaffe2018-07-272-1/+7
| | | | | | | | | | | | | | | | | | Summary: As it was, always exporting LLVM_LINK_LLVM_DYLIB caused out-of-tree clients to lose the ability to link against the dylib, even if in-tree tools did not. By only exporting the setting if it is enabled, out-of-tree clients get the correct default, but may still choose if they can. Reviewers: mgorny, beanz, labath, bogner, chandlerc Reviewed By: bogner, chandlerc Subscribers: bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D49843 llvm-svn: 338119
* [UBSan] Also use blacklist for 'Address; Undefined' settingFlorian Hahn2018-07-201-5/+7
| | | | | | | | | | | | | | | It looks like currently the UBSan blacklist is only applied when "Undefined" is selected. This patch updates the cmake file to apply it whenever Undefined is selected (e.g. 'Address; Undefined' ). This allows us to use the workaround added in rL335525 when using AddressSan and UBSan together. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D49558 llvm-svn: 337539
* Disable GCC's -Wclass-memaccess warningReid Kleckner2018-07-191-0/+5
| | | | | | | | | | | | It fires on things like SmallVector<std::pair<int, int>>, where we intentionally use memcpy instead of calling the assignment operator. This warning fires in practically every LLVM TU, so we have to do something about it, even if we aren't interested in being 100% warning clean with GCC. Reported as PR37337 llvm-svn: 337492
* [CMake] Export the LLVM_LINK_LLVM_DYLIB settingPhilip Pfaffe2018-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building out-of-tree tools, there are several macros available to automate linking against llvm. An examples is `add_llvm_executable`, or the clang variant of this. These macros use the LLVM_LINK_LLVM_DYLIB option to decide whether to link against libraries defined by setting LLVM_LINK_COMPONENTS or to link against libLLVM instead. Currently this is problematic in out-of-tree targets, because they cannot identify whether this option is required or even available. If the option was enabled in LLVM's own build, the clang libraries are built against libLLVM, so a client linking against those must link against it too. On the other hand the client can't just always link against it, because it might not be available. This is related to D44391, but that change assumed the client knew whether they wanted the dylib or not. Reviewers: mgorny, beanz, labath Reviewed By: mgorny Subscribers: bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D49193 llvm-svn: 337366
* [CMake] Pass CMAKE_INSTALL_DO_STRIP to external projectsPetr Hosek2018-07-151-1/+1
| | | | | | | | | This is necessary to make install-<target>-stripped work for external projects such as runtimes. Differential Revision: https://reviews.llvm.org/D49335 llvm-svn: 337115
* [CMake] Teach the build system to codesign built productsJustin Bogner2018-07-101-0/+29
| | | | | | | | | | | Automatically codesign all executables and dynamic libraries if a codesigning identity is given (via LLVM_CODESIGNING_IDENTITY). This option is darwin only for now. Also update platforms/iOS.cmake to pick up the right versions of codesign and codesign_allocate. llvm-svn: 336708
* [cmake] Change WIN32 test to CMAKE_HOST_WIN32Filipe Cabecinhas2018-06-291-1/+1
| | | | | | | | | The test is about what can be run on the host, not the cmake target. When cross-compiling (compiler-rt at least) on Windows, we end up with lit being unable to run llvm-lit because it can't find the llvm-lit module. llvm-svn: 335961
* [CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platformsJustin Bogner2018-06-281-2/+8
| | | | | | | | This allows overriding the strip and dsymutil tools, and updates iOS.cmake to do so. I've also added libtool to iOS.cmake, but it was already respecting CMAKE_LIBTOOL if set. llvm-svn: 335900
* [CMake] Use variables rather than ":" delimitersPetr Hosek2018-06-271-8/+5
| | | | | | | | This is a more idiomatic CMake. Differential Revision: https://reviews.llvm.org/D37644 llvm-svn: 335703
* [CMake] Do not use --gc-sections on OpenBSDBrad Smith2018-06-231-1/+1
| | | | llvm-svn: 335425
* [cmake] Change ON/OFF to YES/NO. NFCShoaib Meenai2018-06-141-9/+9
| | | | | | compnerd pointed out that the latter reads better over here. llvm-svn: 334781
* [cmake] Add linker detection for Apple platformsShoaib Meenai2018-06-141-1/+14
| | | | | | | | | | | | | | | | LLVM currently assumes that Apple platforms will always use ld64. In the future, LLD Mach-O might also be supported, so add the beginnings of linker detection support. ld64 is currently the only detected linker, since `ld64.lld -v` doesn't yield any useful version output, but we can add that detection later, and in the meantime it's still useful to have the ld64 identification. Switch clang's order file check to use this new detection rather than just checking for the presence of an ld64 executable. Differential Revision: https://reviews.llvm.org/D48201 llvm-svn: 334780
* [CMake] Pass additional CMake tools to external projectsPetr Hosek2018-06-061-2/+22
| | | | | | | | | This is needed when the external projects try to use other tools besides just the compiler and the linker. Differential Revision: https://reviews.llvm.org/D47833 llvm-svn: 334136
* [cmake] fix a typo in llvm_config macroPavel Labath2018-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The macro parses out the USE_SHARED option out of the argument list, but then ignores it and accesses the variable with the same name instead. It seems the intention here was to check the argument value. Technically, this is NFC, because the only in-tree usage (add_llvm_executable) of USE_SHARED sets both the variable and the argument when calling llvm_config, but it makes the usage of this macro for out-of-tree users more sensible. Reviewers: mgorny, beanz Reviewed By: mgorny Subscribers: foutrelis, llvm-commits Differential Revision: https://reviews.llvm.org/D44420 llvm-svn: 334082
* Use -Wextra spelling instead of -WNico Weber2018-05-311-1/+1
| | | | | | | No difference in behavior, but a bit easier to search for. https://reviews.llvm.org/D47490 llvm-svn: 333651
* Remove CMake workaround for LLD PR24476 which is no longer neededReid Kleckner2018-05-211-8/+0
| | | | llvm-svn: 332880
* Revert 332750, llvm part (see comment on D46910).Nico Weber2018-05-201-4/+4
| | | | llvm-svn: 332823
* Enable colored diagnostics in ninja builds when building with gcc 4.9+.Nico Weber2018-05-191-4/+6
| | | | | | | | GCC has supported -fdiagnostics-color since 4.9. https://reviews.llvm.org/D47083 llvm-svn: 332793
* [Support] Avoid normalization in sys::getDefaultTargetTriplePetr Hosek2018-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | The return value of sys::getDefaultTargetTriple, which is derived from -DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target, and in the future also to control the search path directly; as such it should be used textually, without interpretation by LLVM. Normalization of this value may lead to unexpected results, for example if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu, normalization will transform that value to x86_64--linux-gnu. Driver will use that value to search for tools prefixed with x86_64--linux-gnu- which may be confusing. This is also inconsistent with the behavior of the --target flag which is taken as-is without any normalization and overrides the value of LLVM_DEFAULT_TARGET_TRIPLE. Users of sys::getDefaultTargetTriple already perform their own normalization as needed, so this change shouldn't impact existing logic. Differential Revision: https://reviews.llvm.org/D46910 llvm-svn: 332750
* [CMake] Make optimizing sanitizer builds optionalChris Bieneman2018-05-171-1/+1
| | | | | | This behavior has been the default for a long time, so the default value is On, however this can make it difficult to debug sanitizer failures, so we should have an option to turn it off. llvm-svn: 332628
* [CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug infoPetr Hosek2018-05-091-3/+3
| | | | | | | | | | Don't hardcode objcopy and strip names, rather use CMAKE_OBJCOPY and CMAKE_STRIP variables which allows users to override the tools used such as using llvm-objcopy and llvm-strip instead of binutils versions. Differential Revision: https://reviews.llvm.org/D46611 llvm-svn: 331827
* Revert r330742: Let TableGen write output only if it changed, instead of ↵Chandler Carruth2018-05-071-4/+16
| | | | | | | | | | | | | | | | | | | | doing so in cmake. This change causes us to re-run tablegen for every single target on every single build. This is much, much worse than the problem being fixed AFAICT. On my system, it makes a clean rebuild of `llc` with nothing changed go from .5s to over 8s. On systems with less parallelism, slower file systems, or high process startup overhead this will be even more extreme. The only way I see this could be a win is in clean builds where we churn the filesystem. But I think incremental rebuild is more important, and so if we want to re-instate this, it needs to be done in a way that doesn't trigger constant re-runs of tablegen. llvm-svn: 331702
* [Support] Support building LLVM for FuchsiaPetr Hosek2018-05-031-3/+3
| | | | | | | | | | These are necessary changes to support building LLVM for Fuchsia. While these are not sufficient to run on Fuchsia, they are still useful when cross-compiling LLVM libraries and runtimes for Fuchsia. Differential Revision: https://reviews.llvm.org/D46345 llvm-svn: 331423
* Stop setting LLVM_ON_WIN32 in config.h and llvm-config.h.Nico Weber2018-04-301-1/+0
| | | | | | | | | | | | | | See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. I replaced all uses of LLVM_ON_WIN32 with _WIN32 in r331127 (llvm), r331069 (clang), r329697 (lldb), r329696 (lld), r329696 (clang-tools-extra). If your out-of-tree program used LLVM_ON_WIN32, just use _WIN32 instead, which is set at exactly the same time to exactly the same value. https://reviews.llvm.org/D46264 llvm-svn: 331224
* [cmake] Make linker detection take flags into accountShoaib Meenai2018-04-261-1/+2
| | | | | | | | | | | | LLVM might be compiled using a toolchain file which controls the linker to use via flags (e.g. `-B` or `-fuse-ld=`). Take these flags into account for linker detection. We can also correct the detection by manually passing LLVM_USE_LINKER, of course, but it seems more convenient to have the detection take flags into account. Differential Revision: https://reviews.llvm.org/D45464 llvm-svn: 330924
* Rename Attributes.gen, Intrinsics.gen to Attributes.inc, Intrinsics.incNico Weber2018-04-251-3/+3
| | | | | | | | | Virtually all other tablegen outputs are called .inc, not .gen, so rename these two too for consistency. No behavior change. https://reviews.llvm.org/D46058 llvm-svn: 330843
* [cmake] Fix libc++ detectionShoaib Meenai2018-04-241-2/+4
| | | | | | | | | | | -stdlib=libc++ is added to both the compilation and the link flags, but the logic for adding it was only checking if it was supported during compilation and not linking. This could lead to false positives, for example when using clang with libstdc++ (where the compiler would support -stdlib=libc++ but then linking would fail because of libc++ actually being unavailable). llvm-svn: 330761
* Let TableGen write output only if it changed, instead of doing so in cmake.Nico Weber2018-04-241-16/+4
| | | | | | | | | | | Removes one subprocess and one temp file from the build for each tablegen invocation. No intended behavior change. https://reviews.llvm.org/D45899 llvm-svn: 330742
* Revert "build: reserve `--color-diagnostics` for lld"Saleem Abdulrasool2018-04-161-1/+1
| | | | | | | | | | | | This reverts SVN r330158. Seems that there was a change to linker flags handling in SVN r316972. That would alter the behaviour to correct the linker flag handling in CMake (requiring CMake 3.4.3+). Since that is already the minimum version required for LLVM, hard coding the knowledge of the linker is not required, which is a strictly better solution. llvm-svn: 330161
* build: reserve `--color-diagnostics` for lldSaleem Abdulrasool2018-04-161-1/+1
| | | | | | | | | | When building out-of-tree compilers (e.g. swift), the linker check here may yield incorrect values. Ensure that we are using lld before we attempt to use `--color-diagnostics` for the linker. Other linkers (i.e bfd, gold) do not support this flag and the test can pass in some cases and then fail subsequently when building. llvm-svn: 330158
* [Build][NFC] Split off libpfm detection to a separate module.Clement Courbet2018-04-111-0/+23
| | | | llvm-svn: 329783
* Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru2018-03-291-3/+3
| | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. Like patch https://reviews.llvm.org/D41808, I propose that we rename libLLVM-7.0svn.so to libLLVM-7svn.so This patch will also rename downstream libraries like liblldb-7.0 to liblldb-7 Reviewers: axw, beanz, dim, hans Reviewed By: dim, hans Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D41869 llvm-svn: 328768
OpenPOWER on IntegriCloud