summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r349517 "[CMake] Default options for faster executables on MSVC"Alexandre Ganea2018-12-192-17/+0
| | | | llvm-svn: 349656
* Revert r349517 "[CMake] Default options for faster executables on MSVC"Alexandre Ganea2018-12-191-6/+0
| | | | llvm-svn: 349654
* Let TableGen write output only if it changed, instead of doing so in cmake, ↵Nico Weber2018-12-191-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | attempt 2 This relands r330742: """ Let TableGen write output only if it changed, instead of doing so in cmake. Removes one subprocess and one temp file from the build for each tablegen invocation. No intended behavior change. """ In particular, if you see rebuilds after this change that you didn't see before this change, that's unintended and it's fine to revert this change again (but let me know). r330742 got reverted because some people reported that llvm-tblgen ran on every build after it. This could happen if the depfile output got deleted without deleting the main .inc output. To fix, make TableGen always write the depfile, but keep writing the main .inc output only if it has changed. This matches what we did in cmake before. Differential Revision: https://reviews.llvm.org/D55842 llvm-svn: 349624
* Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"Alexandre Ganea2018-12-191-0/+6
| | | | | | | | | Previously, when compiling Visual Studio targets, one could see random build errors. This was caused by tablegen projects using the same build folders. This workaround simply chains tablegen projects. Differential Revision: https://reviews.llvm.org/D54153 llvm-svn: 349596
* Revert r349541 (Fix MSVC dependency issue between Clang-tablegen and ↵Alexandre Ganea2018-12-181-6/+0
| | | | | | LLVM-tablegen) llvm-svn: 349545
* Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegenAlexandre Ganea2018-12-181-0/+6
| | | | | | | | | Previously, when compiling Visual Studio targets, one could see random build errors. This was caused by tablegen projects using the same build folders. This workaround simply chains tablegen projects. Differential Revision: https://reviews.llvm.org/D54153 llvm-svn: 349541
* [CMake] Default options for faster executables on MSVCAlexandre Ganea2018-12-182-0/+17
| | | | | | | | | | - Disable incremental linking by default. /INCREMENTAL adds extra thunks in the EXE, which makes execution slower. - Set /MT (static CRT lib) by default instead of CMake's default /MD (dll CRT lib). The previous default /MD makes all DLL functions to be thunked, thus making execution slower (memcmp, memset, etc.) - Adds LLVM_ENABLE_INCREMENTAL_LINK which is set to OFF by default. Differential revision: https://reviews.llvm.org/D55056 llvm-svn: 349517
* [CMake] llvm_codesign workaround for Xcode double-signing errorsStefan Granitz2018-12-131-12/+13
| | | | | | | | | | | | | | | | | Summary: When using Xcode to build LLVM with code signing, the post-build rule is executed even if the actual build-step was skipped. This causes double-signing errors. We can currently only avoid it by passing the `--force` flag. Plus some polishing for my previous patch D54443. Reviewers: beanz, kubamracek Reviewed By: kubamracek Subscribers: #lldb, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D55116 llvm-svn: 349070
* [CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()Stefan Granitz2018-12-071-5/+9
| | | | | | | | | | | | | | | | Summary: Allow clients to suppress setup of default RPATHs in designated library targets. This is used in LLDB when emitting liblldb as a framework bundle, which itself doesn't load further RPATH-dependent libraries. This follows the approach in add_llvm_executable(). Reviewers: aprantl, JDevlieghere, davide, friss Reviewed By: aprantl Subscribers: mgorny, lldb-commits, llvm-commits, #lldb Differential Revision: https://reviews.llvm.org/D55316 llvm-svn: 348573
* [cmake] Clean up add_llvm_subdirectoryShoaib Meenai2018-12-031-14/+17
| | | | | | | | | | | | | | | | | I found the pattern of setting the project_BUILD variable to OFF after processing the project to be pretty confusing. Using global properties to explicitly keep track of whether a project has been processed or not seems much more straightforward, and it also allows us to convert the macro into a function (which is required for the early return). Factor the project+type+name combination out into a variable while I'm here, since it's used a whole bunch of times. I don't believe this should result in any functional changes. Differential Revision: https://reviews.llvm.org/D55104 llvm-svn: 348180
* [CMake] Add LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR for custom dSYM target ↵Stefan Granitz2018-12-031-1/+8
| | | | | | | | | | | | | | | | directory on Darwin Summary: When using `LLVM_EXTERNALIZE_DEBUGINFO` in LLDB, the default dSYM location for the shared library in LLDB.framework is inside the framework bundle. With `LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR` we can easily fix that. I consider it a useful feature to be able to set a global output directory for external debug info (rather then having a target-specific one). Only implemented for Darwin so far. Reviewers: beanz, aprantl Reviewed By: aprantl Subscribers: mgorny, aprantl, #lldb, lldb-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55114 llvm-svn: 348118
* [CMake] build correctly if build path contains whitespaceShoaib Meenai2018-11-301-3/+3
| | | | | | | | | | | | | | | The add_llvm_symbol_exports function in AddLLVM.cmake creates command line link flags with paths containing CMAKE_CURRENT_BINARY_DIR, but that will break if CMAKE_CURRENT_BINARY_DIR contains whitespace. This patch adds quotes to those paths. Fixes PR39843. Patch by John Garvin. Differential Revision: https://reviews.llvm.org/D55081 llvm-svn: 347937
* [Support/FileSystem] Add sub-second precision for atime/mtime of ↵Argyrios Kyrtzidis2018-11-261-0/+6
| | | | | | | | | | | | | | | | | | | | sys::fs::file_status on unix platforms Summary: getLastAccessedTime() and getLastModificationTime() provided times in nanoseconds but with only 1 second resolution, even when the underlying file system could provide more precise times than that. These changes add sub-second precision for unix platforms that support improved precision. Also add some comments to make sure people are aware that the resolution of times can vary across different file systems. Reviewers: labath, zturner, aaron.ballman, kristina Reviewed By: aaron.ballman, kristina Subscribers: lebedev.ri, mgorny, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D54826 llvm-svn: 347530
* Revert r343473 "Move llvm util dependencies from clang-tools-extra to ↵Haojian Wu2018-11-221-10/+0
| | | | | | | | | | | | | | | | add_lit_target." Summary: It will cause test tools `FileCheck`, `count`, `not` being built blindly, these dependencies should move back to clang-tools-extra. Reviewers: mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54797 llvm-svn: 347448
* Silence C4709 in MSVC because it is buggy.Aaron Ballman2018-11-201-0/+4
| | | | | | The diagnostic will trigger on code that does not have any comma operator, but instead default-constructs an object with an explicitly defaulted constructor as the array index argument. llvm-svn: 347345
* Swap order of discovering of -ltinfo and -lterminfoKamil Rytarowski2018-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with native curses(3) and -ltinfo is a part of ncurses. Set -lterminfo before -ltinfo, as it allows to prioritize native curses libraries. Mixing curses and ncurses does not work well, especially in software built on top of llvm. Original patch by Ryo Onodera (NetBSD) in pkgsrc. Reviewers: labath, dim, mgorny Reviewed By: dim, mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54650 llvm-svn: 347156
* [CMake] Accept ENTITLEMENTS in add_llvm_executable and llvm_codesignStefan Granitz2018-11-161-6/+22
| | | | | | | | | | | | | | Summary: Allow code-signing with entitlements. FORCE may be used to avoid an error when replacing existing signatures. Reviewers: beanz, bogner Reviewed By: beanz Subscribers: mgorny, llvm-commits, lldb-commits Differential Revision: https://reviews.llvm.org/D54443 llvm-svn: 347068
* [CMake] Support cross-compiling with multi-stage buildsPetr Hosek2018-11-161-1/+28
| | | | | | | | | | | | | | | | | | | | When using multi-stage builds, we would like support cross-compilation. Example is 2-stage build when the first stage is compiled for host while the second stage is compiled for the target. Normally, the second stage would be also used for compiling runtimes, but that's not possible when cross-compiling, so we use the first stage compiler instead. However, we still want to use the second stage paths. To do so, we set the -resource-dir of the first stage compiler to point to the resource directory of the second stage. We also need compiler tools that support the target architecture. These tools are not guaranteed to be present on the host, but in case of multi-stage build, we can build these tools in the first stage. Differential Revision: https://reviews.llvm.org/D54461 llvm-svn: 347025
* Fix DragonFlyBSD linkage issue.David Carlier2018-11-101-1/+2
| | | | | | environ global failed on LTO linkage step. llvm-svn: 346593
* [CMake] Expose opt-remark tooling through libOptRemarks.dylibFrancis Visoiu Mistrih2018-11-051-0/+1
| | | | | | | | | | | | * Create an install target for it * Add it under tools/opt-remarks * Add an export file for the dylib * Install the llvm-c/OptRemarks.h header * Add an API to query its version rdar://45458839 llvm-svn: 346127
* Enable -Wimplicit-fallthrough for clang as well as GCCReid Kleckner2018-11-011-0/+1
| | | | | | | All instances of this warning should already be fixed across all LLVM subprojects, at least on Linux. llvm-svn: 345887
* [MinGW] Enable large file for mingw-w64Martin Storsjo2018-10-241-0/+4
| | | | | | | | 64-bit mingw doesn't define _FILE_OFFSET_BITS=64 by default. Differential Revision: https://reviews.llvm.org/D53569 llvm-svn: 345131
* [CMake] Use LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPESChris Bieneman2018-10-152-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. This is a re-land of r340435, with a few minor fix-ups. The issues causing the revert were addressed in r344218, r344219, and r344553. llvm-svn: 344555
* [CMake] Change the default value of LLVM_ENABLE_IDEChris Bieneman2018-10-151-10/+13
| | | | | | | | There really aren't any generator behaviors that we need to take `CMAKE_EXTRA_GENERATOR` into account for. Where we need to take different behaviors for IDEs is mostly in enabling or disabling certain build system features that are optional but trip up the IDE UIs. Like the generation of lots of utility targets. By changing the LLVM_ENABLE_IDE default to only being on for multi-configuration generators, we allow gating where it will impact the UI presentation, while also supporting optionally disabling the generation if your tooling workflow encounters problems. Presently being able to manually disable extra target generation is useful for Visual Studio 2017's CMake integration where the IDE has trouble displaying and working with the large number of optional targets. llvm-svn: 344553
* [CMake] Temporarily remove the LLVM_ENABLE_IDE optionChris Bieneman2018-10-111-6/+10
| | | | | | All uses of this option have been removed, and the intent is to change the purpose and default value of this option. To prevent it from having impacts on users, this patch temporarily removes the option and purges it from CMake caches. In a few days, once this has propagated to contributors I will re-introduce the option with the new default value. llvm-svn: 344219
* [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
* [CMake] NFC. Updating documentation on optionsChris Bieneman2018-10-101-2/+2
| | | | | | | The Ninja pool options are only supported with the Ninja generator and should be called out as such. llvm-svn: 344188
* [cmake] Also create lowercase extension WinSDK symlinksShoaib Meenai2018-10-051-5/+19
| | | | | | | | | | | | | Some projects rely on using libraries from the Windows SDK with their original casing, just with a lowercase extension. E.g. the WinSock2 lib is named WS2_32.Lib in the Windows SDK, and we would previously only create a ws2_32.lib symlink for it (i.e. all lowercase). Also create a WS2_32.lib symlink (i.e. original casing with lowercase extension) to cover users of this casing. As a drive-by fix, only create these symlinks when they differ from the original name to reduce the amount of noise in the library symlinks directory. llvm-svn: 343832
* Move llvm util dependencies from clang-tools-extra to add_lit_target.Haojian Wu2018-10-011-0/+11
| | | | | | | | | | | | | | Summary: Address fixme in r301762. And would simplify the cmake file in clang-tools-extra. Reviewers: sammccall Subscribers: mgorny, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D52713 llvm-svn: 343473
* [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
OpenPOWER on IntegriCloud