summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* [clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone buildMichal Gorny2019-10-071-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D68412 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373936 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] [cmake] Add distribution install targets for remaining componentsMichal Gorny2019-10-041-2/+8
| | | | | | | | | Add install targets as necessary to install bash-autocomplete, scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS. Differential Revision: https://reviews.llvm.org/D68413 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373695 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Don't set Python_ADDITIONAL_VERSIONSJonas Devlieghere2019-07-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's Python support to 2.7. Now that both LLVM and LLDB both support Python 3, there's no longer a need to put an arbitrary limit on this. However, instead of removing the variable, r365692 expanded the list, which has the (presumably unintentional) side-effect of expression preference for Python 3. Instead, as Michal proposed in the original code review, we should just not set the list at all, and let CMake pick whatever Python interpreter you have in your path. This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm, clang and lld. I've also updated the docs with the default behavior and how to force a different Python version to be used. Differential revision: https://reviews.llvm.org/D64894 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366447 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename libclang_shared to libclang-cppSylvestre Ledru2019-07-111-1/+1
| | | | | | | | | | | | | | | | Summary: Fix bug 42475 Reviewers: beanz, tstellar Reviewed By: beanz Subscribers: kimgr, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64278 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365831 91177308-0d34-0410-b5e6-96231b3b80d8
* cmake: Add CLANG_LINK_CLANG_DYLIB optionTom Stellard2019-07-031-0/+8
| | | | | | | | | | | | | | | | Summary: Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against libclang_shared.so instead of the individual component libraries. Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru Subscribers: arphaman, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63503 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365092 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved everything SMT-related to LLVM and updated the cmake scripts.Mikhail R. Gadelha2019-03-251-26/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D54978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356929 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Remove cmake warning message (NFC)Evandro Menezes2019-03-251-1/+2
| | | | | | Recognize an empty string for CLANG_DEFAULT_UNWINDLIB as a valid option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356920 91177308-0d34-0410-b5e6-96231b3b80d8
* Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2]Sterling Augustine2019-03-191-0/+18
| | | | | | | | | | | | | | | | | | | | "clang++ hello.cc --rtlib=compiler-rt" now can works without specifying additional unwind or exception handling libraries. This reworked version of the feature no longer modifies today's default unwind library for compiler-rt: which is nothing. Rather, a user can specify -DCLANG_DEFAULT_UNWINDLIB=libunwind when configuring the compiler. This should address the issues from the previous version. Update tests for new --unwindlib semantics. Differential Revision: https://reviews.llvm.org/D59109 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356508 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add install targets for API headersShoaib Meenai2019-03-111-0/+12
| | | | | | | | | | | | | Add an install target for clang's API headers, which allows them to be included in distributions. The install rules already existed, but they lacked a component and a target, making them only accessible via a full install. These headers are useful for writing clang-based tooling, for example. They're the clang equivalent to the llvm-headers target and complement the clang-libraries target. Differential Revision: https://reviews.llvm.org/D58317 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355853 91177308-0d34-0410-b5e6-96231b3b80d8
* Passthrough compiler launcherJF Bastien2019-03-061-0/+2
| | | | | | | | | | | | | | Summary: Not having this seems like an oversight, and makes stage2 builds odd. Reviewers: ddunbar, dexonsmith Subscribers: mgorny, jkorous, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59032 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355547 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Switch to LLVM_ENABLE_IDEShoaib Meenai2019-02-201-2/+2
| | | | | | | | | | | | r344555 switched LLVM to guarding install targets with LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES, which expresses the intent more directly and can be overridden by a user. Make the corresponding change in clang. LLVM_ENABLE_IDE is computed by HandleLLVMOptions, so it should be available for both standalone and integrated builds. Differential Revision: https://reviews.llvm.org/D58284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354525 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Fix stand-alone clang builds since r353268Tom Stellard2019-02-201-0/+5
| | | | | | | | | | | | | | | | | | | Summary: Handle the case where LLVM_MAIN_SRC_DIR is not set and also use LLVM_CMAKE_DIR for locating installed cmake files rather than LLVM_CMAKE_PATH. Reviewers: phosek, andrewrk, smeenai Reviewed By: phosek, andrewrk, smeenai Subscribers: mgorny, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58204 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354417 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add build and install targets for clang librariesShoaib Meenai2019-02-151-0/+21
| | | | | | | | | | | | | | | This is modeled after the existing llvm-libraries target. It's a convenient way to include all clang libraries in a distribution. This differs slightly from the llvm-libraries target in that it adds any library added via add_clang_library, whereas llvm-libraries only includes targets added via add_llvm_library that didn't use the MODULE or BUILDTREE_ONLY arguments. add_clang_library doesn't appear to have any equivalents of those arguments, so the conditions don't apply. Differential Revision: https://reviews.llvm.org/D58269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354141 91177308-0d34-0410-b5e6-96231b3b80d8
* This reverts commit 1440a848a635849b97f7a5cfa0ecc40d37451f5b.Mikhail R. Gadelha2019-02-091-1/+26
| | | | | | | | and commit a1853e834c65751f92521f7481b15cf0365e796b. They broke arm and aarch64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353590 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the SMT API to LLVMMikhail R. Gadelha2019-02-071-26/+1
| | | | | | | | Moved everything SMT-related to LLVM and updated the cmake scripts. Differential Revision: https://reviews.llvm.org/D54978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353373 91177308-0d34-0410-b5e6-96231b3b80d8
* inhereit LLVM_ENABLE_LIBXML2David Callahan2018-11-291-7/+10
| | | | | | | | | | | | | | Summary: When building in an LLVM context, we should respect its LLVM_ENABLE_LIBXML2 option. Reviewers: vitalybuka, mspertus, modocache Reviewed By: modocache Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D53212 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347870 91177308-0d34-0410-b5e6-96231b3b80d8
* cmake: z3: Remove EXACT from 4.7.1 after being compatible with 4.8.1Jan Kratochvil2018-11-181-1/+1
| | | | | | | | | | | After check-in of D54391 a comment there by @mikhail.ramalho says: Since we're supporting version 4.8.1 now, the cmake file should be changed to "minimum" instead of "exact". Differential Revision: https://reviews.llvm.org/D54535 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347152 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Support cross-compiling with multi-stage buildsPetr Hosek2018-11-161-3/+30
| | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347025 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Deprecate using llvm-config to detect llvm installationTom Stellard2018-11-131-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang currently uses llvm-config to determine the installation paths for llvm's headers and binaries. clang is also using LLVM's cmake files to determine other information about the LLVM build, like LLVM_LIBDIR_SUFFIX, LLVM_VERSION_*, etc. Since the installation paths are also available via the cmake files, we can simplify the code by only relying on information from cmake about the LLVM install and dropping the use of llvm-config altogether. In addition to simplifying the code, the cmake files have more accurate information about the llvm installation paths. llvm-config assumes that the lib, bin, and cmake directories are always located in the same place relative to the path of the llvm-config executable. This can be wrong if a user decides to install headers, binaries or libraries to a non-standard location: e.g. static libraries installed to /usr/lib/llvm6.0/ This patch takes the first step towards dropping llvm-config by removing the automatic detection of llvm-config (users can still manually supply a path to llvm-config by passing -DLLVM_CONFIG=/usr/bin/llvm-config to cmake) and adding a deprecation warning when users try to use this option. Reviewers: chandlerc, beanz, mgorny, chapuni Subscribers: mehdi_amini, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346732 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Replace open-coded find_packageTom Stellard2018-11-131-7/+2
| | | | | | | | | | | | Reviewers: beanz, mgorny Reviewed By: mgorny Subscribers: cfe-commits, chapuni, llvm-commits Differential Revision: https://reviews.llvm.org/D32577 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346731 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Set CMP0075 to newShoaib Meenai2018-11-081-0/+4
| | | | | | | | | | Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This shouldn't cause any of the configuration checks to give different results, and I verified that a clean configure before and after this change resulted in identical CMake caches on my machine. The same change was done for LLVM in r346377. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346378 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Improved cmake configuration for Z3Enrico Steffinlongo2018-10-131-11/+24
| | | | | | | | | | | | | | | | | | | | | | Summary: Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html). Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON. Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7 Reviewers: NoQ, george.karpenkov, mikhail.ramalho Reviewed By: george.karpenkov Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus Tags: #clang Differential Revision: https://reviews.llvm.org/D50818 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344464 91177308-0d34-0410-b5e6-96231b3b80d8
* [tests] Include Python binding tests in CMake rulesMichal Gorny2018-10-111-1/+4
| | | | | | | | | Add a new CMake rule check-clang-python to run the Python bindings' test suite, and include it in check-all. Differential Revision: https://reviews.llvm.org/D52840 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344258 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r344241 as it broke multiple bots.Aaron Ballman2018-10-111-1/+0
| | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/10814 http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20613 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344244 91177308-0d34-0410-b5e6-96231b3b80d8
* [tests] Include Python binding tests in CMake rulesMichal Gorny2018-10-111-0/+1
| | | | | | | | | Add a new CMake rule check-clang-python to run the Python bindings' test suite, and include it in check-all. Differential Revision: https://reviews.llvm.org/D52840 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344241 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove vestiges of configure buildsystemStephen Kelly2018-08-301-14/+2
| | | | | | | | | | Summary: Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D50738 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341146 91177308-0d34-0410-b5e6-96231b3b80d8
* libclang: add install/distribution targets for pythonSaleem Abdulrasool2018-08-201-0/+3
| | | | | | | | | | | Add installation support for the python bindings for libclang. Add an additional CMake configuration variable to enumerate the python versions for which the bindings should be installed. This allows for a LLVM/clang distribution to distribute the python bindings for libclang as part of the image. Because the python versions need to be explicitly stated by the user, the default image remains unchanged. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340228 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Make bootstrap and compiler-rt depend on cxx-headers.Ahmed Bougacha2018-06-281-3/+8
| | | | | | | | | | | | Since r334468, we no longer always copy the libcxx headers by virtue of their presence when cmake runs. This makes some of the later stages (compiler-rt, and the bootstrapped stages) depend on them being copied, via the cxx-headers target. Differential Revision: https://reviews.llvm.org/D48700 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335898 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply: Add python tool to dump and construct header mapsBruno Cardoso Lopes2018-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Header maps are binary files used by Xcode, which are used to map header names or paths to other locations. Clang has support for those since its inception, but there's not a lot of header map testing around. Since it's a binary format, testing becomes pretty much brittle and its hard to even know what's inside if you don't have the appropriate tools. Add a python based tool that allows creating and dumping header maps based on a json description of those. While here, rewrite tests to use the tool and remove the binary files from the tree. This tool was initially written by Daniel Dunbar. Thanks to Stella Stamenova for helping make this work on Windows. Differential Revision: https://reviews.llvm.org/D46485 rdar://problem/39994722 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335295 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add python tool to dump and construct header maps"Bruno Cardoso Lopes2018-06-211-1/+0
| | | | | | | | | | | This reverts commit fcfa2dd517ec1a6045a81e8247e346d630a22618. Broke bots: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315 http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add python tool to dump and construct header mapsBruno Cardoso Lopes2018-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Header maps are binary files used by Xcode, which are used to map header names or paths to other locations. Clang has support for those since its inception, but there's not a lot of header map testing around. Since it's a binary format, testing becomes pretty much brittle and its hard to even know what's inside if you don't have the appropriate tools. Add a python based tool that allows creating and dumping header maps based on a json description of those. While here, rewrite tests to use the tool and remove the binary files from the tree. This tool was initially written by Daniel Dunbar. Differential Revision: https://reviews.llvm.org/D46485 rdar://problem/39994722 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335177 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Allow specifying extra dependencies of bootstrap stagePetr Hosek2018-06-111-0/+4
| | | | | | | | | This allows adding additional bootstrap dependencies to the bootstrap compiler that may be needed by later stages. Differential Revision: https://reviews.llvm.org/D47355 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334437 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake option to allow enabling experimental new pass manager by defaultPetr Hosek2018-04-061-0/+3
| | | | | | | | | This CMake flag allows setting the default value for the -f[no]-experimental-new-pass-manager flag. Differential Revision: https://reviews.llvm.org/D44330 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329366 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename clang link from clang-X.Y to clang-XSylvestre Ledru2018-03-291-4/+4
| | | | | | | | | | | | | | | | | | | 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. So, instead, I propose the following: Instead of having clang-7.0 in bin/, we will have clang-7 Since also matches was gcc is doing. Reviewers: tstellar, dlj, dim, hans Reviewed By: dim, hans Subscribers: dim, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41808 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328769 91177308-0d34-0410-b5e6-96231b3b80d8
* [FrontEnd] Allow overriding the default C/C++ -std via CMake varsMichal Gorny2018-03-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide two new CMake cache variables -- CLANG_DEFAULT_STD_C and CLANG_DEFAULT_STD_CXX -- that can be used to override the default C/ObjC and C++/ObjC++ standards appropriately. They can be set to one of the identifiers from LangStandards.def, or left unset (the default) to respect the current platform default. This option is mostly intended for compiler vendors that may wish to adjust the defaults their compilers are using. For example, Gentoo planned to use it to set clang and gcc to matching standards, so that we could maintain as much compatibility between different compilers as possible. The code relies on explicit identifiers rather than the string aliases for simplicity. This saves us from the necessity of parsing aliases at build-time or adding additional processing at runtime. For the latter case, it also adds trivial value check -- if incorrect value is passed, the code simply fails to compile through referencing an undefined constant. If the variable is used to redefine the default standard, the explicit value overrides the special case for PS4. It is done this way mostly following other kinds of variables where 'platform defaults' are redefined. Differential Revision: https://reviews.llvm.org/D34365 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326836 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Also pass CMAKE_ASM_COMPILER_ID to next stage when bootstrappingDon Hinton2018-01-191-1/+2
| | | | | | | | | | | | | | | | | | Summary: When setting CMAKE_ASM_COMPILER=clang, we also need to set CMAKE_ASM_COMPILER_ID=Clang. This is needed because cmake won't set CMAKE_ASM_COMPILER_ID if CMAKE_ASM_COMPILER is already set. Without CMAKE_ASM_COMPILER_ID, cmake can't set CMAKE_ASM_COMPILER_OPTIONS_TARGET either, which means CMAKE_ASM_COMPILER_TARGET is ignored, causing cross compiling to fail, i.e., `--target=${CMAKE_ASM_COMPILER_TARGET}` isn't passed. Differential Revision: https://reviews.llvm.org/D42232 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322977 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] NVPTX: Set default/minimum compute capability to sm_35George Rokos2017-12-071-6/+7
| | | | | | | | | | | The current implementation of the nvptx runtime (to be upstreamed shortly) uses the atomicMax operation on 64-bit integers. This is only supported in compute capabilities 3.5 and later. I've changed the clang default to sm_35. Differential Revision: https://reviews.llvm.org/D40977 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320082 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Don't use comma as an alternate separatorPetr Hosek2017-12-051-3/+3
| | | | | | | | | | | Using comma can break in cases when we're passing flags that already use comma as a separator. Fixes PR35504. Differential Revision: https://reviews.llvm.org/D40762 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319720 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Support side-by-side checkouts in multi-stage buildPetr Hosek2017-11-291-1/+3
| | | | | | | | | Passthrough LLVM_ENABLE_{PROJECTS,RUNTIMES} to followup stages to support the side-by-side checkouts (aka monorepo layout). Differential Revision: https://reviews.llvm.org/D40258 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319267 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use LIST_SEPARATOR rather than escaping in ExternalProject_AddPetr Hosek2017-11-291-2/+3
| | | | | | | | | | | Escaping ; in list arguments passed to ExternalProject_Add doesn't seem to be working in newer versions of CMake (see https://public.kitware.com/Bug/view.php?id=16137 for more details). Use a custom LIST_SEPARATOR instead which is the officially supported way. Differential Revision: https://reviews.llvm.org/D40257 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319264 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Use llvm-lit directory when provided for stand-alone buildMichal Gorny2017-11-171-0/+3
| | | | | | | | | | | | | | | After the recent lit test changes, clang attempts to run its tests via llvm-lit by default. However, the llvm-lit binary is not present when performing stand-alone build resulting in a failure out of the box. To solve that, add the llvm-lit directory to CMake when performing a stand-alone build and LLVM sources are provided. This includes the CMake rules generating the llvm-lit binary and effectively makes it possible for clang to use it. Differential Revision: https://reviews.llvm.org/D40142 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318562 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fissionJake Ehrlich2017-11-111-2/+5
| | | | | | | | | | | | llvm-objcopy is getting to where it can be used in non-trivial ways (such as for dwarf fission in clang). It now supports dwarf fission but this feature hasn't been thoroughly tested yet. This change allows people to optionally build clang to use llvm-objcopy rather than GNU objcopy. By default GNU objcopy is still used so nothing should change. Differential Revision: https://reviews.llvm.org/D39029 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317960 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the clang-tblgen-targets project into the Misc folder on IDEs like ↵Aaron Ballman2017-11-041-0/+1
| | | | | | Visual Studio rather than leave it in the root directory. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317419 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][OpenMP] Customize default offloading archJonas Hahnfeld2017-10-171-0/+11
| | | | | | | | | For the shuffle instructions in reductions we need at least sm_30 but the user may want to customize the default architecture. Differential Revision: https://reviews.llvm.org/D38883 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315996 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't search libxml2 if using msan. LLVM already has similar check.Vitaly Buka2017-09-021-4/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312407 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: only try to find the Z3 package when `CLANG_ANALYZER_BUILD_Z3` is ONMehdi Amini2017-08-271-2/+1
| | | | | | | | This avoids the spurious message: Could NOT find Z3 (missing: Z3_LIBRARIES Z3_INCLUDE_DIR) (Required is at least version "4.5") git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311858 91177308-0d34-0410-b5e6-96231b3b80d8
* Integrate Kostya's clang-proto-fuzzer with LLVM.Matt Morehouse2017-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The clang-proto-fuzzer models a subset of C++ as a protobuf and uses libprotobuf-mutator to generate interesting mutations of C++ programs. Clang-proto-fuzzer has already found several bugs in Clang (e.g., https://bugs.llvm.org/show_bug.cgi?id=33747, https://bugs.llvm.org/show_bug.cgi?id=33749). As with clang-fuzzer, clang-proto-fuzzer requires the following cmake flags: - CMAKE_C_COMPILER=clang - CMAKE_CXX_COMPILER=clang++ - LLVM_USE_SANITIZE_COVERAGE=YES // needed for libFuzzer - LLVM_USE_SANITIZER=Address // needed for libFuzzer In addition, clang-proto-fuzzer requires: - CLANG_ENABLE_PROTO_FUZZER=ON clang-proto-fuzzer also requires the following dependencies: - binutils // needed for libprotobuf-mutator - liblzma-dev // needed for libprotobuf-mutator - libz-dev // needed for libprotobuf-mutator - docbook2x // needed for libprotobuf-mutator - Recent version of protobuf [3.3.0 is known to work] A working version of libprotobuf-mutator will automatically be downloaded and built as an external project. Implementation of clang-proto-fuzzer provided by Kostya Serebryany. https://bugs.llvm.org/show_bug.cgi?id=33829 Reviewers: kcc, vitalybuka, bogner Reviewed By: kcc, vitalybuka Subscribers: thakis, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D36324 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310408 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] NFC. Add clang-tablegen-targets utility targetChris Bieneman2017-07-281-1/+2
| | | | | | | | By creating this target other projects that depend on clang-generated headers (like LLDB) will no longer be order-dependent on Clang being processed by CMake first. Also, by creating a dummy of this target in ClangConfig.cmake, projects that can build against out-of-tree clang can freely depend on the target without needing to have conditionals for if clang is in-tree or out-of-tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309390 91177308-0d34-0410-b5e6-96231b3b80d8
* Clang and LLVM search for different versions of libxml2, reset foundEric Beckmann2017-07-261-0/+1
| | | | | | variable before each search so that they don't conflict. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309189 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.NAKAMURA Takumi2017-07-231-0/+7
| | | | | | | | | This gets rid of almost LLVM targets unconditionally depending on intrinsic_gen. Clang's modules still have weird dependencies and hard to remove intrinsics_gen in better way. Then, it'd be better to give whole clang targets depend on intrinsic_gen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308844 91177308-0d34-0410-b5e6-96231b3b80d8