Commit Graph

74 Commits

Author SHA1 Message Date
Nico Weber
b6fe25c476 EXPORTED_SYMBOL_FILE support for cmake
The cmake build didn't support EXPORTED_SYMBOL_FILE. Instead, it had a
Windows-only implementation in tools/lto/CMakeLists.txt, a linux-only
implementation in tools/gold/CMakeLists.txt, and a darwin-only implementation
in tools/clang/tools/libclang/CMakeLists.txt.

This attempts to consolidate these one-offs into a single place. Clients can now
just set LLVM_EXPORTED_SYMBOL_FILE and things (hopefully) Just Work, like in
the make build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-28 23:31:44 +00:00
Nico Weber
621bd8d76a Remove windows newlines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-28 23:26:51 +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
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
Hans Wennborg
e258845a63 cmake: link release builds statically against run-time library on windows (use /MT instead of /MD)
This should fix the problem of snapshot builds created with MSVC 2012 not
working for users with MSVC 2010, etc.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194589 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 18:16:23 +00:00
Yaron Keren
f099f893f3 Remove NDBEUG from all release types compile flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-19 07:30:37 +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
Hans Wennborg
acc1f8b20f CMake: set stack size to 2MB for MSVC builds
Compiling under Visual C++ 2012 with the default stack size of 1MB, the stack
overflows at a depth of 216 template instantiations, well before the 256
default limit. This patch modifies the default MSVC stack size to 2MB.

Patch by Yaron Keren!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 17:49:57 +00:00
Hans Wennborg
29150e45fb cmake: don't set LLVM_COMPILER_IS_GCC_COMPATIBLE when using clang-cl
Tip-of-tree CMake has become clang-cl aware [1]. In this case,
CMAKE_CXX_COMPILER_ID will still be Clang, but MSVC will be true.

[1] See http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d8356d4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 22:03:23 +00:00
Alexey Samsonov
b775f2f39c [CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189747 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 09:15:01 +00:00
Aaron Ballman
7f92c7b52c Re-disabling C4291 warnings for MSVC because AttributeList.h requires it. This was accidentally removed in r187279.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188530 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 03:06:38 +00:00
Eric Christopher
b9db9cd6a9 Make sure that -gsplit-dwarf isn't passed to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187456 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-30 22:34:30 +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
Aaron Ballman
cc6933bd31 Re-application of 187310. Re-enabling warning C4275 for MSVC 11 and up, but not MSVC 10 since it is still required there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187354 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 13:02:08 +00:00
Aaron Ballman
7f817029d5 Partial revert of 187310; it seems MSVC 10 still spits out this warning, but MSVC 11 does not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187331 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-28 18:04:26 +00:00
Aaron Ballman
9df33cbbab Re-enabling some more MSVC warnings; all of these compile cleanly with no further changes required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187310 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 20:20:28 +00:00
Aaron Ballman
fb49c513ac Re-enabling a warning in MSVC mode now that r187292 fixed the only instance of the warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 03:35:44 +00:00
Aaron Ballman
332af10901 Re-enabling some more MSVC warnings; all of these compile cleanly with no further changes required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187279 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 00:13:11 +00:00
Aaron Ballman
252d41691a Re-enabling the C4065 warning for MSVC builds as it no longer fires due to tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187252 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 22:03:03 +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
Rafael Espindola
d132ce7a75 Revert "Cmake: add compiler option in a more idiomatic way"
This reverts commit 183995.

It broke the bots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/9730/steps/build_clang/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-14 19:41:05 +00:00
Arnaud A. de Grandmaison
4ebf543b93 Cmake: add compiler option in a more idiomatic way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-14 19:26:57 +00:00
Arnaud A. de Grandmaison
745825f582 Add colored diagnostics when building LLVM with cmake + ninja + clang
When invoked from Ninja, clang does not detect that it can use colors : see https://github.com/martine/ninja/issues/174

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-29 20:41:35 +00:00
Alexey Samsonov
5eacadd649 Don't explicitly provide -pie in MSan bootstrap of LLVM, as it's now implied by the driver
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 07:18:55 +00:00
Reid Kleckner
16f1969328 [cmake] Avoid rel+asserts warnings when passing -UNDEBUG
MSVC 2012 gives warning D9025, "overriding /D NDEBUG with -UNDEBUG".
Removing the original definition of NDEBUG silences this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178967 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-07 01:45:01 +00:00
Alexey Samsonov
777fccbe65 Add CMake option LLVM_USE_SANITIZER={Address,Memory,MemoryWithOrigins} to simplify bootstrap of LLVM/Clang under ASan/MSan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 07:49:46 +00:00
Duncan Sands
2269c56a3c Don't use add_llvm_definitions for adding warning flags. It makes it too hard
to have them appear in the right order.  Instead append all warnings explicitly
to the language flags.  This was already the case for many warnings.  Fixes the
issue of -Wno-maybe-uninitialized not being effective because -Wall was being
placed after it rather than before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 13:25:34 +00:00
Alexey Samsonov
8483b47926 Enable -Wnon-virtual-dtor build warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 10:10:03 +00:00
Eric Christopher
c6aa834836 Turn anonymous type in anonymous union warning back on after cleaning up
issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 00:43:00 +00:00
Alexey Samsonov
b91ce4fd9b Simplify CMake rules in HandleLLVMOptions module.
Summary: No functionality change.

Reviewers: Bigcheese

Reviewed By: Bigcheese

CC: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13 20:50:23 +00:00
Jordan Rose
e2abe05174 CMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.
Previously we relied on it being included by config-ix.cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176396 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 01:00:40 +00:00
Edwin Vane
4b5dbaa96a Turn off uninitialized-use warnings for gcc in cmake build
Added support to the cmake build to turn off uninitialized use warnings
for gcc. This cleans the build up somewhat.

Used logic simpler than found in autoconf by making use of the fact that
although gcc won't complain about unsupported -Wno-* flags it *will*
complain about unsupported -W flags.

Reviewers: gribozavr, doug.gregor, chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 02:32:44 +00:00
Richard Smith
1983f54dae Add -Wno-nested-anon-types to -pedantic builds of LLVM. This Clang warning
catches uses of an extremely minor and widely-available C++ extension (which
every C++ compiler I could find supports, but EDG and Clang reject in strict
mode).

The diagnosed code pattern looks like this:

struct X {
  union {
    struct {
      int a;
      int b;
    } S;
  };
};


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174103 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 22:19:12 +00:00
Edwin Vane
adc4af6a5b Turn off missing field initializer warnings for gcc
gcc produces false positives for empty braces so turning the warning off.
Instead, turning the warning on for clang so proper warnings aren't missed.
    
Reviewers: dblaikie, chandlerc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 18:05:54 +00:00
NAKAMURA Takumi
1917aaff29 [CMake][Lit][unittests] Deprecate CMAKE_BUILD_TYPE in each build directory for unittests.
For example,
cur) unittests/ADT/Release/ADTTests
new) unittests/ADT/ADTTests

RUNTIME_BUILD_MODE can be substituted to CMAKE_CFG_INTDIR.

With Make and Ninja, the tree is not built with multiple configurations.
Then, including the build type in target directory doesn't make sense.
See also "How can I build multiple modes without switching?"
http://www.cmake.org/Wiki/CMake_FAQ
CMAKE_CFG_INTDIR is set to "."

With multiple-configuration-aware build system, like Visual Studio, each unittest is built on appropriate directory, for example,
unittests/ADT/Release/ADTTests.exe
CMAKE_CFG_INTDIR is set to build system's variable, like "$(Configuration)" or "$(OutDir)".

Thus, "--param build_config" is also deprecated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 12:20:50 +00:00
Reid Kleckner
5b7c057167 Disable MSVC's warning about noreturn destructors
This warning fires on:
  Operator::~Operator() {
    llvm_unreachable("should never destroy an Operator");
  }

That seems like a false positive.  I don't see any good way to silence
the warning here, so I'm disabling it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173455 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 15:36:13 +00:00
Michael J. Spencer
189ef5f2e0 [CMake] MSVC is incorrectly emitting C4239 in some cases. Disable it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 00:00:40 +00:00
Dmitri Gribenko
fa45cdf646 Fix a typo introduced in r168577: FlAGS -> FLAGS (note the lowercase ell)
Now we really pass -Wcovered-switch-default if the compiler supports it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 17:52:48 +00:00
Joe Abbey
d6a93075a1 Removing SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
Adding CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
       C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

This is to handle the wackiness on a Mac host where cmake detects:

CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/gcc"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168577 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 02:02:08 +00:00
Tobias Grosser
2563ad294f cmake: Pass the -m32 flag to modules if LLVM_BUILD_32_BITS is enabled
This was previously only done for executables and shared libraries, but not
for modules. As modules are essentially shared libraries (that need to be
dlopened explicitly), threating them the same as shared libraries seems
reasonable. This fixes the LLVM_BUILD_32_BITS build of Polly.

Contributed by: Ondra Hosek  <ondra.hosek@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158195 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08 09:41:23 +00:00
Michael J. Spencer
67762d1d45 [CMake] Promote extension warnings to errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158176 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07 23:33:56 +00:00
Michael J. Spencer
fa371eaff3 [CMake] Order MSVC warnings numerically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158171 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07 21:34:31 +00:00
Michael J. Spencer
c3ab9ce3c9 [CMake] Adjust MSVC warnings.
Remove /Wall from LLVM_ENABLE_WARNINGS (it's useless) and promote 4239
to a level 1 warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158170 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07 21:34:15 +00:00
Tim Northover
4c8657a957 Fix how CMake appends -m32 to linker command-lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157337 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23 18:42:02 +00:00
Rafael Espindola
869d817aa7 Adding -fcolor-diagnostics is causing problem to users that parse the build
output. Peter Collingbourne also reports that it is showing up in
$(llvm-config --cflags).

Revert this for now since I don't know enough cmake to fix it properly.

This reverts commit 18efed7adc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156392 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-08 18:11:06 +00:00
Rafael Espindola
18efed7adc Pass -fcolor-diagnostics when it is supported. This makes a difference when
using cmake+ninja, since ninja buffers the compiler output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-04 03:23:36 +00:00
NAKAMURA Takumi
4a80d64194 CMake: Enable LLVM_COMPILER_JOBS on all MS IDEs. We don't support older environments than VS9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 14:51:02 +00:00
NAKAMURA Takumi
5bfe3bf8d1 CMake: Prune redundant LLVM_COMPILER_JOBS from llvm/CMakeLists.txt. HandleLLVMOptions.cmake has it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155284 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 14:50:56 +00:00
Michael J. Spencer
647c0ce48c Minimal changes for LLVM to compile under VS11.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 22:42:52 +00:00