Commit Graph

310 Commits

Author SHA1 Message Date
Chris Bieneman
71926e73ba Adding llvm-shlib to CMake build system with a few new bells and whistles
Summary:
This patch adds a new CMake build setting LLVM_BUILD_LLVM_DYLIB, which defaults to OFF. When set to ON, this will generate a shared library containing most of LLVM. The contents of the shared library can be overriden by specifying LLVM_DYLIB_COMPONENTS. LLVM_DYLIB_COMPONENTS can be set to a semi-colon delimited list of any LLVM components that you llvm-config can resolve.

On Windows, unless you are using Cygwin, you must specify an explicit symbol export file using LLVM_EXPORTED_SYMBOL_FILE. On Cygwin and all unix-like platforms if you do not specify LLVM_EXPORTED_SYMBOL_FILE, an export file containing only the LLVM C API will be auto-generated from the list of LLVM components specified in LLVM_DYLIB_COMPONENTS.

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, llvm-commits

Differential Revision: http://reviews.llvm.org/D5890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220490 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 17:22:14 +00:00
Richard Smith
173573736b Add LLVM_ENABLE_MODULES flag to CMake to enable building with C++ modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218551 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26 22:40:15 +00:00
Chris Bieneman
901166c939 Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line
The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217105 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-03 23:21:18 +00:00
Viktor Kutuzov
d9aaca0ecc Fix building with in-tree libc++abi on FreeBSD
Differential Revision: http://reviews.llvm.org/D4743


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214541 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 19:23:15 +00:00
Hans Wennborg
0b783fc554 Update LLVM version: 3.5 => 3.6
We branched 3.5, it's now time to work on 3.6.

This is Sylvestre's patch from [1] plus regenerated configure
file by me, and minus the release notes reset, which Sean
pointed out [2] should happen later.

 1. http://reviews.llvm.org/D4660
 2. http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140721/111137.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214131 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-28 22:10:52 +00:00
NAKAMURA Takumi
1f8525a98f [CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.
For now, its user is configure_lit_site_cfg().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-04 04:23:26 +00:00
Rafael Espindola
67c5f45306 Delete utils/FileUpdate.
It is unused and it looks like it was never used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-23 17:58:39 +00:00
Matt Arsenault
231097bc9d Delete trailing whitespace.
Hopefully this forces cmake to re-run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210830 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 21:27:03 +00:00
Alp Toker
79d08abe9c CMake: don't install the internal config.h header
Background:
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/073707.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210766 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-12 11:25:18 +00:00
Alp Toker
7a0e6972ce Make LINK_POLLY_INTO_TOOLS work with the CMake build
The option check was being performed after config.h/llvm-config.h substitution,
generating incorrect macro definitions.

Fixes PR19614.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210311 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 06:39:00 +00:00
Tim Northover
29f94c7201 AArch64/ARM64: move ARM64 into AArch64's place
This commit starts with a "git mv ARM64 AArch64" and continues out
from there, renaming the C++ classes, intrinsics, and other
target-local objects for consistency.

"ARM64" test directories are also moved, and tests that began their
life in ARM64 use an arm64 triple, those from AArch64 use an aarch64
triple. Both should be equivalent though.

This finishes the AArch64 merge, and everyone should feel free to
continue committing as normal now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-24 12:50:23 +00:00
Tim Northover
9105f66d6f AArch64/ARM64: remove AArch64 from tree prior to renaming ARM64.
I'm doing this in two phases for a better "git blame" record. This
commit removes the previous AArch64 backend and redirects all
functionality to ARM64. It also deduplicates test-lines and removes
orphaned AArch64 tests.

The next step will be "git mv ARM64 AArch64" and rewire most of the
tests.

Hopefully LLVM is still functional, though it would be even better if
no-one ever had to care because the rename happens straight
afterwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209576 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-24 12:42:26 +00:00
Alexey Samsonov
0f0974ddb9 [CMake] Add build rules for llvm-PerfectShuffle utility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208225 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-07 16:54:00 +00:00
Reid Kleckner
4c464def6a Added Sphinx documentation generation to CMake build system.
The option LLVM_ENABLE_SPHINX option enables the "docs-llvm-html",
"docs-llvm-man" targets but does not build them by default. The
following CMake options have been added that control what targets are
made available

SPHINX_OUTPUT_HTML
SPHINX_OUTPUT_MAN

If LLVM_BUILD_DOCS is enabled then the enabled docs-llvm-* targets will
be built by default and if ``make install`` is run then docs-llvm-html
and docs-llvm-man will be installed (tested on Linux only).

The add_sphinx_target function is in its own file so it can be included
by other projects that use Sphinx for their documentation.

Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206655 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 21:45:25 +00:00
NAKAMURA Takumi
3a243636d5 [CMake] Reformat, if(MSVC)...else()...endif()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206215 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 21:58:19 +00:00
Pete Cooper
d7e2a48153 Add ability to disable building LLVM utils
Patch by Chris Bieneman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205478 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 22:49:58 +00:00
Tim Northover
7b837d8c75 ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM,
accessible in parallel via the "arm64" triple. The plan over the
coming weeks & months is to merge the two into a single backend,
during which time thorough code review should naturally occur.

Everything will be easier with the target in-tree though, hence this
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 10:18:08 +00:00
Hans Wennborg
b0a50a3f29 Win installer: provide a pretty icon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204960 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:48:37 +00:00
Sebastian Pop
beaa95d97f static link polly into tools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203886 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 04:04:14 +00:00
Sebastian Pop
e5b11b349b move WITH_POLLY option before add_subdirectory(tools)
the first run of the polly buildbot failed, and then it started passing.
This is due to the fact that the buildbot re-builds in an existing directory,
and the first run does not have WITH_POLLY set when it enters tools/.
Thus, cmake ignores the tools/polly dir in the first run, and then because
it reuses the CMakeCache.txt of the previous run, it has the WITH_POLLY set
by the previous run, and so it passes the second time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203615 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 22:42:07 +00:00
Sebastian Pop
789dde4b50 fix PR13550: add a cmake WITH_POLLY option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203486 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 20:47:39 +00:00
Ed Maste
d6728add42 Work around FreeBSD rtld rpath $ORIGIN limitation
FreeBSD's rtld requires the DF_ORIGIN flag set in order to process
$ORIGIN in rpath.

FreeBSD bug http://bugs.freebsd.org/187114


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-09 18:48:45 +00:00
Yaron Keren
b62b44ccc5 Cleaning up a bunch of pre-Visual C++ 2012 build hacks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202806 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 09:23:33 +00:00
Tom Stellard
db3064e438 Add patch level to llvm version in CMake and Autoconf
The shared library generated by autoconf will now be called
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX).so
and a symlink named
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX).so will
also be created in the install directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202720 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 15:22:00 +00:00
Chandler Carruth
b23750a8ae [C++11] Switch the CMake option from LLVM_ENABLE_CXX11 (default on) to
LLVM_ENABLE_CXX1Y (default *off*). =D C++98 is dead. Long live C++11.

I don't exactly recommend using C++1y just yet though...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202567 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-01 03:16:07 +00:00
Reid Kleckner
c1d2eda565 [CMake] Remove dead C backend option
Patch by Jevin Sweval!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 22:51:27 +00:00
Chandler Carruth
7166b2820d [C++11] Switch CMake to use C++11 by default! Next up, autoconf/make!
Now, please don't get too excited. I've just toggled the default to suss
out the last remaining bot problems. This does *not* mean we can all go
write lots of C++11 code yet. I at least want to let the dust settle
from the bots first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 21:30:03 +00:00
Rafael Espindola
37c04a0d4d Centralize the handling of install_name and rpath.
This centralizes the Makefile handling of -install_name and -rpath. It also
moves the cmake build to using @rpath. The reason being that libclang needs it,
and it works for everything else.

A followup patch will move clang to using this and then there will be a single
point to edit to support other systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202499 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 13:48:03 +00:00
Alexey Samsonov
9e443ca92a [CMake] Introduce LLVM_BUILD_EXTERNAL_COMPILER_RT option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202363 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 08:59:01 +00:00
Rafael Espindola
692c94c1c9 Use an install name dir of @executable_path/../lib instead of @rpath.
Using @executable_path/../lib matches what we have on Makefiles and works
with older versions of OS X too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 21:51:28 +00:00
NAKAMURA Takumi
38f8e8ac22 [CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
For now, use both keywords, INTERFACE and PRIVATE via the variable,
  - ${cmake_2_8_12_INTERFACE}
  - ${cmake_2_8_12_PRIVATE}

They could be cleaned up when we introduce 2.8.12.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202239 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 06:45:11 +00:00
Bernard Ogden
70b3b7d06f Permit CMAKE_INSTALL_RPATH to be set on command line
Commit 201921 overrides setting of CMAKE_INSTALL_RPATH via the
command line. Last time this happened we applied another patch
to only set CMAKE_INSTALL_RPATH if already defined (r197825).
This patch does the same thing again, but only for the UNIX
case - we leave APPLE alone as presumably the original committer
is happy with the non-overriding behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24 22:23:43 +00:00
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