summaryrefslogtreecommitdiff
path: root/cmake/modules/HandleLLVMOptions.cmake
Commit message (Collapse)AuthorAge
* [CMake] Enhance llvm_update_compile_flags(name sources) to handle ↵NAKAMURA Takumi2014-01-28
| | | | | | | | | | | | | | | | LLVM_REQUIRES_EH and LLVM_REQUIRES_RTTI. LLVM_REQUIRES_EH implies LLVM_REQUIRES_RTTI. It is as same behavior as Makefile.rule's. llvm/examples/ExceptionDemo is affected. (It was built with -fno-rtti.) For MSVC, Remove flags like "/EHsc /GR" in HandleLLVMOptions, or CL.EXE complains with flags like "/GR /GR-". llvm_update_compile_flags() updates source file property if the target contains *.c. COMPILE_FLAGS in target properties affects both C++ and C! LLVM_NO_RTTI is deprecated. It was introduced by me and was my mistake. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200301 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Apply -ffunction-data-sectinos not only to CMAKE_CXX_FLAGS, but also ↵NAKAMURA Takumi2014-01-28
| | | | | | to CMAKE_C_FLAGS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200300 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Move -ffunction-data-sections stuff to HandleLLVMOptions.NAKAMURA Takumi2014-01-28
| | | | | | | | With this tweaks, also unittests are compiled with -ffunction-sections. It's hard to control contextual CMAKE_CXX_FLAGS. We should get rid of twiddling it as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200299 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't clobber CMAKE_REQUIRED_FLAGS, it ends up being used inChandler Carruth2014-01-21
| | | | | | C compilations as well and these flags don't make any sense there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199756 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VS2012 ID/version check.Amara Emerson2014-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199753 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix libstdc++4.7 test on Android.Evgeniy Stepanov2014-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199714 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the test for libstdc++ versions newer than 4.6 so we don'tChandler Carruth2014-01-17
| | | | | | | | accidentally pick that up while using Clang and run into subtle bugs down the road related to C++11 features not fully implemented in that version of the standard library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199484 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the option and checking of compiler version better. Put theChandler Carruth2014-01-13
| | | | | | | | 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
* CMake: Provide LLVM_PLUGIN_EXT definitionAlp Toker2014-01-08
| | | | | | | | | | | | | | | This is needed to support the addition of tests for clang loadable plugins. In clang, plugins are built as modules (bundles on OS X) rather than dynamic libraries (dylib) so the build system needs to inform lit of the actual file extension in use, typically '.so' on Unix and '.dll' on Windows. (LLVM itself should probably switch to this scheme to fix PR14903 once and for all.) No change in build output or functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198746 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ ↵Jean-Daniel Dupas2014-01-06
| | | | | | | | | | | | | | 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
* EXPORTED_SYMBOL_FILE support for cmakeNico Weber2013-12-28
| | | | | | | | | | | | | | 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
* Remove windows newlines.Nico Weber2013-12-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198135 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake : optionaly enable LLVM to be compiled with -std=c++11 (default: off)Arnaud A. de Grandmaison2013-11-26
| | | | | | | | | | 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
* Revert my CMake patches concerning building with /MT (r194589, r194596)Hans Wennborg2013-11-13
| | | | | | 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
* CMake: make building with /MT an option instead of always forcing itHans Wennborg2013-11-13
| | | | | | | | | | | | | 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
* cmake: link release builds statically against run-time library on windows ↵Hans Wennborg2013-11-13
| | | | | | | | | | | (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
* Remove NDBEUG from all release types compile flags.Yaron Keren2013-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193031 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: set stack size for MSVC in just one placeHans Wennborg2013-10-17
| | | | | | | | | | | 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
* CMake: set stack size to 2MB for MSVC buildsHans Wennborg2013-10-17
| | | | | | | | | | 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
* cmake: don't set LLVM_COMPILER_IS_GCC_COMPATIBLE when using clang-clHans Wennborg2013-10-07
| | | | | | | | | 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
* [CMake] Add -O1 in debug builds with LLVM_USE_SANITIZERAlexey Samsonov2013-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189747 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-disabling C4291 warnings for MSVC because AttributeList.h requires it. ↵Aaron Ballman2013-08-16
| | | | | | This was accidentally removed in r187279. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188530 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that -gsplit-dwarf isn't passed to the linker.Eric Christopher2013-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187456 91177308-0d34-0410-b5e6-96231b3b80d8
* Add capability for building with -gsplit-dwarf to the cmake build.Eric Christopher2013-07-30
| | | | | | 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
* Re-application of 187310. Re-enabling warning C4275 for MSVC 11 and up, but ↵Aaron Ballman2013-07-29
| | | | | | 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
* Partial revert of 187310; it seems MSVC 10 still spits out this warning, but ↵Aaron Ballman2013-07-28
| | | | | | MSVC 11 does not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187331 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enabling some more MSVC warnings; all of these compile cleanly with no ↵Aaron Ballman2013-07-27
| | | | | | further changes required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187310 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enabling a warning in MSVC mode now that r187292 fixed the only instance ↵Aaron Ballman2013-07-27
| | | | | | of the warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187293 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enabling some more MSVC warnings; all of these compile cleanly with no ↵Aaron Ballman2013-07-27
| | | | | | further changes required. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187279 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enabling the C4065 warning for MSVC builds as it no longer fires due to ↵Aaron Ballman2013-07-26
| | | | | | tablegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187252 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS.Duncan Sands2013-07-17
| | | | | | | | | | | | | | | 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
* Revert "Cmake: add compiler option in a more idiomatic way"Rafael Espindola2013-06-14
| | | | | | | | | 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
* Cmake: add compiler option in a more idiomatic wayArnaud A. de Grandmaison2013-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183995 91177308-0d34-0410-b5e6-96231b3b80d8
* Add colored diagnostics when building LLVM with cmake + ninja + clangArnaud A. de Grandmaison2013-05-29
| | | | | | 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
* Don't explicitly provide -pie in MSan bootstrap of LLVM, as it's now implied ↵Alexey Samsonov2013-04-12
| | | | | | by the driver git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179367 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Avoid rel+asserts warnings when passing -UNDEBUGReid Kleckner2013-04-07
| | | | | | | 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
* Add CMake option LLVM_USE_SANITIZER={Address,Memory,MemoryWithOrigins} to ↵Alexey Samsonov2013-03-26
| | | | | | 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
* Don't use add_llvm_definitions for adding warning flags. It makes it too hardDuncan Sands2013-03-25
| | | | | | | | | | 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
* Enable -Wnon-virtual-dtor build warningAlexey Samsonov2013-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177385 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn anonymous type in anonymous union warning back on after cleaning upEric Christopher2013-03-15
| | | | | | issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177136 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify CMake rules in HandleLLVMOptions module.Alexey Samsonov2013-03-13
| | | | | | | | | | | | | | 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
* CMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.Jordan Rose2013-03-02
| | | | | | 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
* Turn off uninitialized-use warnings for gcc in cmake buildEdwin Vane2013-02-04
| | | | | | | | | | | | | | 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
* Add -Wno-nested-anon-types to -pedantic builds of LLVM. This Clang warningRichard Smith2013-01-31
| | | | | | | | | | | | | | | | | | | | 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
* Turn off missing field initializer warnings for gccEdwin Vane2013-01-31
| | | | | | | | | | 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
* [CMake][Lit][unittests] Deprecate CMAKE_BUILD_TYPE in each build directory ↵NAKAMURA Takumi2013-01-27
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Disable MSVC's warning about noreturn destructorsReid Kleckner2013-01-25
| | | | | | | | | | | | 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
* [CMake] MSVC is incorrectly emitting C4239 in some cases. Disable it.Michael J. Spencer2013-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171430 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo introduced in r168577: FlAGS -> FLAGS (note the lowercase ell)Dmitri Gribenko2012-12-24
| | | | | | | 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
* Removing SUPPORTS_COVERED_SWITCH_DEFAULT_FLAGJoe Abbey2012-11-26
| | | | | | | | | | | | | | 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