Commit Graph

278 Commits

Author SHA1 Message Date
Rafael Espindola
fb24ccfa32 Revert "Revert "Use relative rpath so that the installation and build dirs are relocatable.""
This reverts commit r201934.

Polly has been fixed to work with this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201936 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 13:29:31 +00:00
Rafael Espindola
ea5f6769f6 Revert "Use relative rpath so that the installation and build dirs are relocatable."
This reverts commit r201921.

This should bring the polly bots back. I will try to build it locally to
understand how cmake was setting the rpath of LLVMPolly.so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201934 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 12:36:28 +00:00
Rafael Espindola
c94f3ae027 Use relative rpath so that the installation and build dirs are relocatable.
This works by asking cmake to use the "install rpath", but setting that rpath
to be relative.

Thanks a lot to Brad King for the help with CMake!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201921 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 00:54:14 +00:00
NAKAMURA Takumi
282713c09b Fix LLVM install rules to not set permissions on include/
The CMake install(DIRECTORY) command documents that it sets permissions
on directories it is asked to install.  Since the <prefix>/include
directory may not be exclusive to the LLVM installation, we should not
ask CMake to manage permissions of that directory for us.  Instead, give
only our own include/llvm and include/llvm-c subdirectories to the
install(DIRECTORY) command.

Fixes PR4500. Patch by Brad King.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201075 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-10 10:50:55 +00:00
Jordan Rose
1b7969eee2 [CMake] Move -stdlib=libc++ handling into its own file.
r200744 moved this into cmake/config-ix.cmake, so that it would happen very
early in the build process. However, standalone builds of Clang and other
external projects never include this file (which is correct).

Now, -stdlib=libc++ and the LLVM_COMPILER_IS_GCC_COMPATIBLE option are
both set in a new include file, HandleLLVMStdlib, which is included by
both config-ix.cmake and HandleLLVMOptions.cmake. This preserves existing
behavior for projects relying on HandleLLVMOptions and still does the
right thing for builds of LLVM itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200811 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-05 00:02:37 +00:00
Alexey Samsonov
caeb7f94c7 [CMake] Add -stdlib=libc++ to host Clang build flags before performing any header search
If LLVM_ENABLE_LIBCXX is specified, we should append -stdlib=libc++ to build
flags as early as possible, in particular, before we check for header presence
(as -stdlib=libc++ modifies header lookup rules). Otherwise we can find a header
at configure time (w/o -stdlib=libc++) but fail to find it at build time
(with -stdlib=libc++). See PR18569 for more details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200744 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-04 07:55:18 +00:00
NAKAMURA Takumi
640dd7695d [CMake] Move cmake_minimum_required(2.8.8) at the top.
Suggested by Stephen Kelly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200645 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 16:59:36 +00:00
NAKAMURA Takumi
1089c2c9ba [CMake] Move libgtest for external projects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200558 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 17:32:46 +00:00
NAKAMURA Takumi
6a9e4a8254 [CMake] Introduce new scheme of LLVM_TOOLS_BINARY_DIR and LLVM_LIBRARY_DIR
In LLVM build tree, they points corresponding INTDIR.

  In Clang standalone tree, they points external dir (llvm-config's --bindir and --libdir).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199595 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-19 12:52:10 +00:00
NAKAMURA Takumi
f594ef9a1a [CMake] Add comments in llvm/CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199594 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-19 12:47:26 +00:00
NAKAMURA Takumi
a0375d550f [CMake] Deprecate LLVM_TOOLS_BINARY_DIR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-19 12:47:22 +00:00
Chandler Carruth
55e6c6184a Factor the option and checking of compiler version better. Put the
option with the others in the top level CMakeLists, and put the check in
HandleLLVMOptions. This will also let it be used from the standalone
Clang builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199149 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 22:21:34 +00:00
Chandler Carruth
d00ec5ef7b Raise the minimum CMake version to 2.8.8 -- we have a report that the
compiler version checking doesn't work on 2.8.7. This feature was
documented in 2.8.10, but existed for an unknown amount of time before
that.

I'm actually happy to revert this and remove the use of the feature if
there is anyone with a specific problem updating CMake. Please just let
me know. I don't want to re-implement this CMake functionality unless
there is a reason, and this is the only real way to find that out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 22:05:20 +00:00
NAKAMURA Takumi
a5761de415 [CMake] Move BUG_REPORT_URL from clang to llvm.
It was too late to set BUG_REPORT_URL after configure_file(config.h).
BUG_REPORT_URL in config.h.cmake would be updated at 2nd run of cmake.
It caused many recompilations.

FYI, configure handles BUG_REPORT_URL in llvm side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 05:25:13 +00:00
Jean-Daniel Dupas
1abc3c0b7f Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ instead of the system default
Summary:
This parameter is required to build C++11 projects (like lld or lldb) on OS X as the default STL does not provide c++ classes.


CC: llvm-commits, triton

Differential Revision: http://llvm-reviews.chandlerc.com/D2381

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198625 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 18:27:27 +00:00
NAKAMURA Takumi
74ae52847d [CMake][VS][XCode] Restruct the output directory layout more comfortable, ${BINARY_DIR}/${BUILD_MODE}/(bin|lib)
We have been seeing nasty directory layout with CMake multiconfig, such as,
  bin/Release/clang.exe
  lib/clang/3.x/...
  lib/Release/clang/3.x/.. (duplicated)

Move the layout similar to autoconf's;
  Release/bin/clang.exe
  Release/lib/clang/3.x/...

Checked on Visual Studio 10. Could you guys please confirm my change on XCode(and other multiconfig builders)?

Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more, or a certain builder, for eaxample, msbuild.exe, would be confused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-30 06:48:30 +00:00
Artyom Skrobov
fc90ff9692 Resinstate the command line taking priority over CMakeLists in setting CMAKE_INSTALL_RPATH
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-20 18:13:12 +00:00
Rafael Espindola
b4fcab42ca Use $ORIGIN when setting rpath.
This matches what the configure build does.

Patch by Jan Vesely.

Fixes pr14189.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19 23:13:58 +00:00
NAKAMURA Takumi
742c278977 [CMake] Introduce LLVM_RUNTIME_OUTPUT_INTDIR and LLVM_LIBRARY_OUTPUT_INTDIR to reduce references to CMAKE_CFG_INTDIR.
Each of them forms like;
  ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}
  ${CMAKE_BINARY_DIR}/lib/${CMAKE_CFG_INTDIR}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197394 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-16 16:03:08 +00:00
NAKAMURA Takumi
3e33675c00 [CMake] Introduce LLVM_INCLUDE_DIR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-16 15:05:39 +00:00
Arnaud A. de Grandmaison
7c6be4d558 CMake : optionaly enable LLVM to be compiled with -std=c++11 (default: off)
In some case, it may be required to build LLVM in C++11 mode, as some the subprojects (like lldb) requires it.

This mimics the autoconf behaviour.

However, given the discussions on the switch to C++11 of the codebase, this behaviour should evolve to default to C++11 with some checks of the compiler capabilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195727 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 10:33:53 +00:00
Hans Wennborg
896a0a27f7 CMake: Some changes to package version names:
- Allow overriding PACKAGE_VERSION from the command-line
- Use PACKAGE_VERSION to set CPACK_PACKAGE_VERSION (used by the Win installer)
- Don't include the version number in the CPack install dir or registry key.

Differential revision: http://llvm-reviews.chandlerc.com/D2245

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195379 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-21 22:47:21 +00:00
NAKAMURA Takumi
7a8d0d7ff7 llvm/CMakeLists.txt: Update LLVM_VERSION_MINOR to 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195247 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20 13:11:48 +00:00
Hans Wennborg
7adae8e795 Revert my CMake patches concerning building with /MT (r194589, r194596)
Reid pointed out we already have LLVM_USE_CRT_{buildtype} to set it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194604 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 20:29:10 +00:00
Hans Wennborg
4ac2e3c604 CMake: make building with /MT an option instead of always forcing it
for release builds.

This is a follow-up to r194589. Aaron pointed out that building
libraries with /MT and using them in an application that uses a
different run-time library can be a bad idea.

Move the option to build with /MT behind a CMake option so it can be
turned on selectively, such as when building the toolchain installer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194596 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 19:12:02 +00:00
Rafael Espindola
14de0899bc Modify CMakeLists.txt to work around pr17763 and bring some bots back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 22:13:41 +00:00
Bill Wendling
9297890972 Remove 2.4 from the list of supported Python versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193541 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 21:22:23 +00:00
Hans Wennborg
4d1a925675 CMake: set stack size for MSVC in just one place
After r192904, Reid pointed out he thought we already set the stack
size for MSVC. Turns out we did, but it didn't seem to work.

This commit sets the stack size in a single place, using
CMAKE_EXE_LINKER_FLAGS because that seems to be the way that works
best.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 18:39:47 +00:00
Alexey Samsonov
651c467130 Restore LLVM_BUILD_RUNTIME option that was deleted in r191835, but is still used to control building of compiler-rt and libcxx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191948 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 10:41:38 +00:00
Chandler Carruth
dd5d86d992 Remove the very substantial, largely unmaintained legacy PGO
infrastructure.

This was essentially work toward PGO based on a design that had several
flaws, partially dating from a time when LLVM had a different
architecture, and with an effort to modernize it abandoned without being
completed. Since then, it has bitrotted for several years further. The
result is nearly unusable, and isn't helping any of the modern PGO
efforts. Instead, it is getting in the way, adding confusion about PGO
in LLVM and distracting everyone with maintenance on essentially dead
code. Removing it paves the way for modern efforts around PGO.

Among other effects, this removes the last of the runtime libraries from
LLVM. Those are being developed in the separate 'compiler-rt' project
now, with somewhat different licensing specifically more approriate for
runtimes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191835 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-02 15:42:23 +00:00
Rafael Espindola
19c450af62 Set the minimal stack size with msvc when using cmake >= 2.8.11.
This makes sure we get the same behavior with all supported cmake versions. Once
we support only versions >= 2.8.11 we can experiment with other values or just
setting it for some binaries.

Patch by Greg Bedwell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 14:06:55 +00:00
Daniel Dunbar
e179b31bfc [conf] Add config variable to disable crash related overrides.
- We do some nasty things w.r.t. installing or overriding signal handlers in
   order to improve our crash recovery support or interaction with crash
   reporting software, and those things are not necessarily appropriate when
   LLVM is being linked into a client application that has its own ideas about
   how to do things. This gives those clients a way to disable that handling at
   build time.

 - Currently, the code this guards is all Apple specific, but other platforms
   might have the same concerns so I went for a more generic configure
   name. Someone who is more familiar with library embedding on Windows can
   handle choosing which of the Windows/Signals.inc behaviors might make sense
   to go under this flag.

 - This also fixes the proper autoconf'ing of ENABLE_BACKTRACES. The code
   expects it to be undefined when disabled, but the autoconf check was just
   defining it to 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 20:39:21 +00:00
Reid Kleckner
002062b024 Substitute LLVM's version into the msbuild property file at config time
Requires shuffling the CPack code up before add_subdirectory(tools), but
that's where the version settings are anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 22:09:43 +00:00
Hans Wennborg
110b5209d9 cmake: Add msbuild integration to the install
This adds the msbuild integration files to the install, provides batch scripts
for (un)installing it in a convenient way, and hooks up the nsis installer to
run those scripts.

Differential Revision: http://llvm-reviews.chandlerc.com/D1537

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 01:19:26 +00:00
Hans Wennborg
d19346524c CMake: move lto.h install to tools/lto/CMakeLists.txt
It looked misplaced in the main CMakeLists.txt file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189230 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 16:54:12 +00:00
Michael Gottesman
5b83d0c092 [autotools->cmake] Enable generation of doxygen documentation via cmake.
I am going to add in a subsequent patch support for generating the llvm
manpage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189164 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-24 07:25:21 +00:00
Hans Wennborg
2982c08884 CMake: Add LLVM_INSTALL_TOOLCHAIN_ONLY option.
Differential Revision: http://llvm-reviews.chandlerc.com/D1428

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-24 00:20:36 +00:00
Hans Wennborg
da44b4f68b CMake: polish the Windows packaging rules
This tweaks the CMake rules for building an installation package on Windows:
 - Sets license file (otherwise nsis shows an ugly default)
 - Adds LLVM logo
 - Shows "do you want to add this to the system path" dialog.

Differential Revision: http://llvm-reviews.chandlerc.com/D1414

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188509 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 23:44:31 +00:00
Michael Gottesman
20e4636c12 Fixed typo in CMakeLists.txt.
We were marking both LLVMBUILDOUTPUT and LLVMBUILDERRORS as
ERROR_VARIABLES when clearly LLVMBUILDOUTPUT should be marked as
OUTPUT_VARIABLE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 04:16:12 +00:00
Chandler Carruth
8d8bdff6d7 Target a minimal terminfo library rather than necessarily a full curses
library for color support detection. This still will use a curses
library if that is all we have available on the system. This change
tries to use a smaller subset of the curses library, specifically the
subset that is on some systems split off into a separate library. For
example, if you install ncurses configured --with-tinfo, a 'libtinfo' is
install that provides just the terminfo querying functionality. That
library is now used instead of curses when it is available.

This happens to fix a build error on systems with that library because
when we tried to link ncurses into the binary, we didn't pull tinfo in
as well. =]

It should also provide an easy path for supporting the NetBSD
libterminfo library, but as I don't have access to a NetBSD system I'm
leaving adding that support to those folks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 09:49:17 +00:00
Chandler Carruth
f7364d5833 Add support for linking against a curses library when available and
using it to detect whether or not a terminal supports colors. This
replaces a particularly egregious hack that merely compared the TERM
environment variable to "dumb". That doesn't really translate to
a reasonable experience for users that have actually ensured their
terminal's capabilities are accurately reflected.

This makes testing a terminal for color support somewhat more expensive,
but it is called very rarely anyways. The important fast path when the
output is being piped somewhere is already in place.

The global lock may seem excessive, but the spec for calling into curses
is *terrible*. The whole library is terrible, and I spent quite a bit of
time looking for a better way of doing this before convincing myself
that this was the fundamentally correct way to behave. The damage of the
curses library is very narrowly confined, and we continue to use raw
escape codes for actually manipulating the colors which is a much sane
system than directly using curses here (IMO).

If this causes trouble for folks, please let me know. I've tested it on
Linux and will watch the bots carefully. I've also worked to account for
the variances of curses interfaces that I could finde documentation for,
but that may not have been sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187874 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 08:47:36 +00:00
Eric Christopher
6aebd5facb Add capability for building with -gsplit-dwarf to the cmake build.
In limited testing this seems to work. Caveat emptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187452 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-30 21:44:10 +00:00
Rafael Espindola
6fccaafd8b Remove the mblaze backend from llvm.
Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-25 18:55:05 +00:00
Duncan Sands
a009d53c4d Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS.
The issue is that CMAKE_BUILD_TYPE=RelWithDebInfo LLVM_ENABLE_ASSERTIONS=ON was
not building with assertions enabled.  (I was unable to find what in the LLVM
source tree was adding -DNDEBUG to the build line in this case, so decided that
it must be cmake itself that was adding it - this may depend on the cmake
version).  The fix treats any mode that is not Debug as being the same as
Release for this purpose (previously it was being assumed that cmake would only
add -DNDEBUG for Release and not for RelWithDebInfo or MinSizeRel).  If other
versions of cmake don't add -DNDEBUG for RelWithDebInfo then that's OK: with
this change you just get a useless but harmless -UNDEBUG or -DNDEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186499 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-17 09:34:51 +00:00
Andy Gibbs
84bb3a2af2 Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26 07:57:53 +00:00
Reid Kleckner
dfad9e314e Look for Python 2 before Python 3 in CMakeLists.txt
All of LLVM's Python scripts only support Python 2 for widely understood
reasons.

Patch by Yonggang Luo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 13:21:16 +00:00
Rafael Espindola
67295357cc Allow duplicates in LLVM_TARGETS_TO_BUILD and LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.
Should fix the cmake bots that were already building R600.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-22 02:45:28 +00:00
Rafael Espindola
059d360266 Make R600 non-experimental.
The r600 backend has been in tree for some time now. Marking it as
non-experimental to avoid accidental breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182442 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-22 00:35:47 +00:00
Tim Northover
233a4d7124 AArch64: enable MCJIT unittests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182217 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 19:44:56 +00:00
Rafael Espindola
baa52fff39 Change version to 3.4 in the cmake build too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181353 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 20:44:22 +00:00