summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
AgeCommit message (Collapse)Author
2016-06-09[CMake] Fix an issue building out-of-tree introduced in r272200Chris Bieneman
The out-of-tree build needs to read LLVM_TOOLS_INSTALL_DIR out of TOOLS_BINARY_DIR because LLVM_TOOLS_INSTALL_DIR is used by AddLLVM.cmake git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03Don't pass --build-id to ld by default.Rafael Espindola
We now have a cmake option to change the default: ENABLE_LINKER_BUILD_ID. The reason is that build-id is fairly expensive, so we shouldn't impose it in the regular edit/build cycle. This is similar to gcc, that has an off by default --enable-linker-build-id option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31[CMake] Update to requiring CMake 3.4.3Chris Bieneman
Summary: This is as per the discussions on developer lists: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20823 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27[CMake] On Darwin bootstrap LTO builds set DYLD_LIBRARY_PATH instead of ↵Chris Bieneman
using llvm-ar llvm-ar isn't really supported for Darwin, instead the host tools will load libLTO, so we can use the just-built libLTO. This actually makes Darwin bootstrap builds a little faster because you don't need to build llvm-ar before starting the next stage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-08[Perf-Training] Reworked workflow improvements for order-file generationChris Bieneman
This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64. Original Summary: With this change generating clang order files using dtrace uses the following workflow: cmake <whatever options you want> ninja generate-order-file ninja clang This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one. CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28Convert to Unix line endings due to previous commit error.Mike Spertus
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28Use VS2015 Project Support for Natvis to eliminate the need to manually ↵Mike Spertus
install clang native visualizer This is the clang equivalent to llvm commit 264601. When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations. Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-15[CMake] Defaulting CLANG_VENDOR to PACKAGE_VENDORChris Bieneman
LLVM r263566 adds a generic PACKAGE_VENDOR configuration which can be used to specify the vendor for LLVM toolchain tools. This change defaults the CLANG_VENDOR to the PACKAGE_VENDOR so that you don't have to specify both when building a package. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263570 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26[CMake] Add BINUTILS_INCDIR to the default passthrough list for multi-stage ↵Chris Bieneman
builds This is needed to build the gold plugin in multi-stage builds. Patch by Mike Edwards Differential Revision: http://reviews.llvm.org/D17655 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17[cmake] Revert r260742 (and r260744) to improve order file support.Chandler Carruth
This appears to be passing '-Wl,-order_file' to Linux link commands, which then causes the linker to silently, behind the scenes, write the output to 'rder_file' instead of somewhere else. Will work with Chris to figure out the proper support for this, but so far there are numerous people who can't get Clang to update when they build because of this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12[CMake] Fixing bots I broke.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12[CMake] Improve the clang order-file generation workflowChris Bieneman
Summary: This commit re-lands r259862. The underlying cause of the build breakage was an incorrectly written capabilities test. In tools/Driver/CMakeLists.txt I was attempting to check if a linker flag worked, the test was passing it to the compiler, not the linker. CMake doesn't have a linker test, so we have a hand-rolled one. Original Patch Review: http://reviews.llvm.org/D16896 Original Summary: With this change generating clang order files using dtrace uses the following workflow: cmake <whatever options you want> ninja generate-order-file ninja clang This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one. CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file. Reviewers: bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16999 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12[CMake] Pass stage1 tools through to stage2 when building with LTOChris Bieneman
This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12[CMake] Add option to switch default C++ stdlibJonas Hahnfeld
With this option one can optionally override the architecture dependent default library to use if no -stdlib= is provided on compiler invocation. Differential Revision: http://reviews.llvm.org/D15920 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10[CMake] Pass LLVM_EXTERNAL_*_SOURCE_DIR variables to subsequent stagesChris Bieneman
For multi-stage builds we need to pass any overridden source directory variables. Without passing these the subsequent stages won't find the project sources. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05[CMake] One more try to make CMake clean up after itselfChris Bieneman
Seriously... CMake... You're on my list... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05Revert "[CMake] Improve the clang order-file generation workflow"Chris Bieneman
This reverts commit r259862, and attempts to fix builder CMakeCaches. Will try this again some other time... Conflicts: CMakeLists.txt tools/driver/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05[CMake] One more try to fix this.Chris Bieneman
This change will catch any bots that generated the order file that GNU ld doesn't like and delete it before trying to generate one that I think GNU ld will deal with. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05[CMake] Speculative fix for linker error on LinuxChris Bieneman
I can't reproduce this locally, but I think this may fix it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05[CMake] Improve the clang order-file generation workflowChris Bieneman
Summary: With this change generating clang order files using dtrace uses the following workflow: cmake <whatever options you want> ninja generate-order-file ninja clang This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one. CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file. Reviewers: bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16896 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04Install cmake files to lib/cmake/clangNiels Ole Salscheider
This is the right location for platform-specific files. Also, search for LLVM's CMake files in this directory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19[CMake] Don't apply Export set to clang toolsChris Bieneman
I can't apply export to tools without getting some strange CMake spew. The behavior here is a bit unexpected. CMake is complaining about static link dependencies not being in the same export set, which shouldn't matter. In the short term it is easier to just remove the export set (which was just added in r258209) while I sort this out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19[CMake] Creating add_clang_tool macro to wrap add_clang_executable and ↵Chris Bieneman
generate install actions and targets. This change brings forward the LLVM convention that "executables" are just runnable binaries, and "tools" are executables that are part of the project's install. Having this abstraction will allow us to simplify some of the tool CMakeLists files, and it will standardize some of the install behaviors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19[CMake] Properly respect the CLANG_APPEND_VC_REV optionChris Bieneman
Only set -DSVN_REVISION if CLANG_APPEND_VC_REV=On git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[CMake] Move the install logic for libclang's headers into the libclang ↵Chris Bieneman
CMakelists This makes it so if you disable building libclang you won't install the headers as part of the 'install' target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=OnChris Bieneman
This matches autoconf's ability to put clang revisions in the clang --version spew. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05[CMake] Support a simple case for bootstrap builds to generate PGO dataChris Bieneman
Summary: This patch adds support for the clang multi-stage bootstrapping to support PGO profdata generation, and can build a 2 or 3 stage compiler. With this patch applied you can configure your build directory with the following invocation of CMake: cmake -G <generator> -C <path_to_clang>/cmake/caches/PGO.cmake <source dir> After configuration the following additional targets will be generated: stage2-instrumented: Builds a stage1 x86 compiler, runtime, and required tools (llvm-config, llvm-profdata) then uses that compiler to build an instrumented stage2 compiler. stage2-instrumented-generate-profdata: Depends on "stage2-instrumented" and will use the instrumented compiler to generate profdata based on the training files in <clang>/utils/perf-training stage2: Depends on "stage2-instrumented-generate-profdata" and will use the stage1 compiler with the stage2 profdata to build a PGO-optimized compiler. stage2-check-llvm: Depends on stage2 and runs check-llvm using the stage3 compiler. stage2-check-clang: Depends on stage2 and runs check-clang using the stage3 compiler. stage2-check-all: Depends on stage2 and runs check-all using the stage3 compiler. stage2-test-suite: Depends on stage2 and runs the test-suite using the stage3 compiler (requires in-tree test-suite). Reviewers: bogner, silvas, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15584 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256873 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19Revert "[CMake] Support a simple case for bootstrap builds to generate PGO data"Chris Bieneman
This reverts commit r256069, which was an unintentional tag along on another commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-19[CMake] Support a simple case for bootstrap builds to generate PGO dataChris Bieneman
Summary: This patch adds support for the clang multi-stage bootstrapping to support PGO profdata generation, and can build a 2 or 3 stage compiler. With this patch applied you can configure your build directory with the following invocation of CMake: cmake -G <generator> -C <path_to_clang>/cmake/caches/PGO.cmake <source dir> After configuration the following additional targets will be generated: stage2-instrumented: Builds a stage1 x86 compiler, runtime, and required tools (llvm-config, llvm-profdata) then uses that compiler to build an instrumented stage2 compiler. stage2-instrumented-generate-profdata: Depends on "stage2-instrumented" and will use the instrumented compiler to generate profdata based on the training files in <clang>/utils/perf-training stage2: Depends on "stage2-instrumented-generate-profdata" and will use the stage1 compiler with the stage2 profdata to build a PGO-optimized compiler. stage2-check-llvm: Depends on stage2 and runs check-llvm using the stage3 compiler. stage2-check-clang: Depends on stage2 and runs check-clang using the stage3 compiler. stage2-check-all: Depends on stage2 and runs check-all using the stage3 compiler. stage2-test-suite: Depends on stage2 and runs the test-suite using the stage3 compiler (requires in-tree test-suite). Reviewers: bogner, silvas, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15584 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16[CMake] Name the bootstrap stages stage[0-9]Chris Bieneman
When you start chaining bootstrap stages the CMake-generated targets get unwieldy. This change supports naming the bootstrap targets and creating wrapper targets in the top-level build file. Without this patch the default target generated for a second stage build was "bootstrap" with it the target is "stage2". Also with some CMake goop setting CLANG_BOOTSTRAP_TARGETS, you can expose third stage targets as "stage3" instead of "bootstrap-bootstrap" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16[CMake] If you're building compiler-rt, the bootstrap build should depend on it.Chris Bieneman
Adding optional dependency for the bootstrap targets on compiler-rt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16[CMake] Make CLANG_BOOTSTRAP_TARGETS overridableChris Bieneman
This allows exposing a custom list of targets from the next stage build up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16[CMake] Add support for generating profdata for clang from training filesChris Bieneman
Summary: This patch adds support for using LIT to drive generating PGO profile data for clang. This first pass implementation should work on Linux and Unix based platforms. If you build clang using CMake with LLVM_BUILD_INSTRUMENTED=On the CMake build generates a generate-profdata target that will use the just-built clang to build any test files (see hello_world.cpp as an example). Each test compile will generate profraw files for each clang process. After all tests have run CMake will merge the profraw files using llvm-profdata. Future opportunities for extension: * Support for Build->Profile->Build bootstrapping * Support for linker order file generation using a similar mechanism and the same training data * Support for Windows Reviewers: dexonsmith, friss, bogner, cmatthews, vsk, silvas Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15462 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-10[OPENMP] Make -fopenmp to turn on OpenMP support by default, clang partAlexey Bataev
Patch turns on OpenMP support in clang by default after fixing OpenMP buildbots. Differential Revision: http://reviews.llvm.org/D13803 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23NFC. Fixing my consistently incorrect spelling.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253937 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20[CMake] Add support for specifying arguments to the bootstrap build.Chris Bieneman
This adds support for three types of argument specifications for bootstrap builds: (1) Arguments prefixed with BOOTSTRAP_* will be passed through with the leading BOOTSTRAP_ removed. (2) CLANG_BOOTSTRAP_PASSTHROUGH can specify a list of variables to be passed through as they are set. (3) BOOTSTRAP_DEFAULT_PASSTHROUGH is a list of some default passthrough variables that are always passed through. Those variables include the version string and should only specify variables that are always expected to be the same between the stage1 and stage2 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13[CMake] If 'INTERNAL_INSTALL_PREFIX' is set, use it for determining the ↵Argyrios Kyrtzidis
install destination of c-index-test and the libclang headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] Setup an install component for libclang and c-index-test.Argyrios Kyrtzidis
Also don't create libclang dylib symlinks on darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252836 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09[CMake] Support passing CMAKE_VERBOSE_MAKEFILE through to bootstrap builds.Chris Bieneman
This option enables full verbosity in recursive CMake builds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20[CMake] Make clang/tools subdirectories controlled via optionsChris Bieneman
Setting CLANG_TOOL_*_BUILD=Off on the CMake command line will disable inclusion of a clang/tools subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10[CMake] Always generate and install cmake config files on CMake>=3.0.NAKAMURA Takumi
Currently, cmake config files are only generated and installed when CLANG_BUILD_STANDALONE set, which means config file will not be generated or installed when clang is built with llvm. This change removes that restriction. Thanks to Don Hinton <hintonda@gmail.com> http://reviews.llvm.org/D13453 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] Fixing LTO library path passed into bootstrap builds.Chris Bieneman
This just fixes a small error in constructing the path to the LTO library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-05[CMake] Move CLANG_INCLUDE_TESTS in advance of add_subdirectory(tools).NAKAMURA Takumi
The target "check-clang-tools" is affected by CLANG_INCLUDE_TESTS but it was undefined in 1st configuration procedure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02[CMake] Fixing clang bootstrap to use LLVM_RUNTIME_OUTPUT_INTDIR instead of ↵Chris Bieneman
CMAKE_BINARY_DIR. This should make bootstrap builds work with multi-configuration generators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249115 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-18[CMake] Refactoring and cleaning up clang symlink generation.Chris Bieneman
Generation of clang symlinks now uses add_clang_symlink macro which uses add_llvm_symlink. Also the list of symlinks to generate is configurable via CLANG_LINKS_TO_CREATE. This re-lands r248015, with fixes for clang symlinks to always be generated as part of the clang and install-clang targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248043 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-18Revert "[CMake] Refactoring and cleaning up clang symlink generation."Chris Bieneman
This reverts commit r248015, because it broke bots. I'll revise and recommit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248025 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-18[CMake] Refactoring and cleaning up clang symlink generation.Chris Bieneman
Generation of clang symlinks now uses add_clang_symlink macro which uses add_llvm_symlink. Also the list of symlinks to generate is configurable via CLANG_LINKS_TO_CREATE. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11[CMake] [Darwin] Add support for building bootstrap builds with -fltoChris Bieneman
When building with LTO the bootstrap builds need to depend on libLTO, llvm-ar, and llvm-ranlib, which all need to be passed into the bootstrap build. This functionality only works on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11[CMake] Making the bootstrap-clear target always delete the boostrap build ↵Chris Bieneman
directories. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247436 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21[CMake][Standalone] Detect Python. Python is used for Lit testing.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245685 91177308-0d34-0410-b5e6-96231b3b80d8