Commit Graph

605 Commits

Author SHA1 Message Date
NAKAMURA Takumi 81b580b455 Teach LLVMConfig to avoid modifying CMAKE_MODULE_PATH
Do not modify this value on the application's behalf and just ensure API
modules are always available next to the LLVMConfig module.  This is
already the case in the install tree so use file(COPY) to make it so in
the build tree.  Include the LLVM-Config API module from next to the
LLVMConfig location.

Contributed by Brad King.

llvm-svn: 201047
2014-02-09 16:35:40 +00:00
NAKAMURA Takumi 3097cdc97d De-duplicate references to share/llvm/cmake path
Use a LLVM_INSTALL_PACKAGE_DIR variable to hold the path and reference
it where necessary.

Contributed by Brad King.

llvm-svn: 201046
2014-02-09 16:35:29 +00:00
Todd Fiala 4ccfe392ed Fix configure to find arc4random via header files.
ISSUE:

On Ubuntu 12.04 LTS, arc4random is provided by libbsd.so, which is a
transitive dependency of libedit. If a system had libedit on it that
was implemented in terms of libbsd.so, then the arc4random test,
previously implemented as a linker test, would succeed with -ledit.
However, on Ubuntu this would also require a #include <bsd/stdlib.h>.
This caused a build breakage on configure-based Ubuntu 12.04 with
libedit installed.

FIX:

This fix changes configure to test for arc4random by searching for it
in the standard header files. On Ubuntu 12.04, this test now properly
fails to find arc4random as it is not defined in the default header
locations. It also tweaks the #define names to match the output of the
header check command, which is slightly different than the linker
function check #defines.

I tested the following scenarios:

(1) Ubuntu 12.04 without the libedit package [did not find arc4random,
as expected]

(2) Ubuntu 12.04 with libedit package [properly did not find
arc4random, as expected]

(3) Ubuntu 12.04 with most recent libedit, custom built, and not
dependent on libbsd.so [properly did not find arc4random, as
expected].

(4) FreeBSD 10.0B1 [properly found arc4random, as expected]

llvm-svn: 200819
2014-02-05 05:04:36 +00:00
Jordan Rose 5fe0f6588e [CMake] Deliberately get all LLVM library dependencies for standalone builds.
CMake won't expand the dependency graph for us if the dependencies are in
another project, which leads to link errors in the standalone build.
This is a refinement of r200765.

llvm-svn: 200812
2014-02-05 00:02:42 +00:00
Jordan Rose 31c5b7b696 [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.

llvm-svn: 200811
2014-02-05 00:02:37 +00:00
NAKAMURA Takumi 7b2528b741 [CMake] Get rid of llvm_config() to expand dependencies.
CMake's target_link_libraries() will manage dependencies.

Configuration time may be reduced by a few seconds.

llvm-svn: 200765
2014-02-04 14:42:14 +00:00
NAKAMURA Takumi 906dad8bb3 [CMake] LLVM-Config.cmake: Split explicit_map_components_to_libraries and introduce llvm_map_components_to_libnames and llvm_expand_dependencies.
llvm-svn: 200764
2014-02-04 14:42:04 +00:00
NAKAMURA Takumi 79aaf8de1a [CMake] add_llvm_loadable_module: Fixup r200762, I mis-eliminated wrong line. :(
llvm-svn: 200763
2014-02-04 13:40:31 +00:00
NAKAMURA Takumi a6c161abac Revert r122395, "Fixes file extension for loadable modules on OS X."
In trunk, every users assume add_llvm_loadable_module as "loadable module" and no one sets neither SHARED, ... nor also MODULE!
Unfortunately, all loadable modules were linked as not "MODULE" but "SHARED".

If this change caused any regressions, I wish guys to fix it properly. ;)

llvm-svn: 200762
2014-02-04 13:33:13 +00:00
Alexey Samsonov 482beff8ae [CMake] Revert r200695 and fix the problem with missing -fno-function-sections in a different way.
llvm-svn: 200745
2014-02-04 08:15:46 +00:00
Alexey Samsonov 34a466f8da [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.

llvm-svn: 200744
2014-02-04 07:55:18 +00:00
NAKAMURA Takumi e6bf06bbdc Revert r200150, "[CMake] tablegen(): Use -I <dir> according to the list by include_directories()."
It missed include/llvm/Target. Could I avoid GLOB_RECURSE anyways? :(
FYI, I intended to prune ${LLVM_MAIN_INCLUDE_DIR} in TableGen.cmake in r200150.

llvm-svn: 200730
2014-02-04 01:17:12 +00:00
Evgeniy Stepanov c7b7e2569c Don't use -ffunction-sections if -fno-function-sections is not supported in the compiler.
This will disable -ffunction-sections in older versions of Clang where it
breaks build of sanitizer runtime library.

llvm-svn: 200695
2014-02-03 13:57:09 +00:00
NAKAMURA Takumi 7829337172 [CMake] Untabify.
llvm-svn: 200644
2014-02-02 16:46:35 +00:00
Peter Collingbourne c7d437c118 Introduce line editor library.
This library will be used by clang-query. I can imagine LLDB becoming another
client of this library, so I think LLVM is a sensible place for it to live.
It wraps libedit, and adds tab completion support.

The code is loosely based on the line editor bits in LLDB, with a few
improvements:

 - Polymorphism for retrieving the list of tab completions, based on
   the concept pattern from the new pass manager.

 - Tab completion doesn't corrupt terminal output if the input covers
   multiple lines. Unfortunately this can only be done in a truly horrible
   way, as far as I can tell. But since the alternative is to implement our
   own line editor (which I don't think LLVM should be in the business of
   doing, at least for now) I think it may be acceptable.

 - Includes a fallback for the case where the user doesn't have libedit
   installed.

Note that this uses C stdio, mainly because libedit also uses C stdio.

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

llvm-svn: 200595
2014-01-31 23:46:14 +00:00
NAKAMURA Takumi d40cdc981d AddLLVM.cmake: Untabify.
llvm-svn: 200557
2014-01-31 17:32:42 +00:00
NAKAMURA Takumi ac624644a8 HandleLLVMOptions.cmake: Typo, s/proerty/property/
llvm-svn: 200556
2014-01-31 17:32:36 +00:00
NAKAMURA Takumi 13961cbc51 [CMake] llvm_update_compile_flags: Honor LLVM_COMPILE_FLAGS.
I accidentally mis-dropped LLVM_COMPILE_FLAGS in r200301. Sorry for that.

llvm-svn: 200499
2014-01-30 22:55:25 +00:00
NAKAMURA Takumi b2acffbbbc HandleLLVMOptions.cmake: Typo in comment.
llvm-svn: 200498
2014-01-30 22:55:20 +00:00
Evgeniy Stepanov 98f4ecfb58 Remove -arm-enable-ehabi from Android build rules. It's enabled by default.
llvm-svn: 200391
2014-01-29 12:36:18 +00:00
NAKAMURA Takumi b524c2227e [CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET PROPERTY SOURCES has them.
llvm-svn: 200311
2014-01-28 11:40:04 +00:00
NAKAMURA Takumi 00d0a2a90d [CMake] Prune CMAKE_CXX_FLAGS stuff in llvm_process_sources.
It is the final step to deprecate contextual CMAKE_CXX_FLAGS.

llvm-svn: 200303
2014-01-28 09:48:19 +00:00
NAKAMURA Takumi a679f43f4e [CMake] Enhance llvm_update_compile_flags(name sources) to handle 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.

llvm-svn: 200301
2014-01-28 09:44:06 +00:00
NAKAMURA Takumi e20725b8da [CMake] Apply -ffunction-data-sectinos not only to CMAKE_CXX_FLAGS, but also to CMAKE_C_FLAGS.
llvm-svn: 200300
2014-01-28 09:44:00 +00:00
NAKAMURA Takumi bb50bceb06 [CMake] Move -ffunction-data-sections stuff to HandleLLVMOptions.
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.

llvm-svn: 200299
2014-01-28 09:43:55 +00:00
NAKAMURA Takumi db441f68b6 [CMake] Let llvm_process_sources check not only *.cpp but also *.c.
llvm-svn: 200298
2014-01-28 09:43:49 +00:00
NAKAMURA Takumi 14f1f44a16 [CMake] Put *_exports into "Misc" folder.
llvm-svn: 200228
2014-01-27 17:39:38 +00:00
NAKAMURA Takumi 4f82397a20 [CMake] tablegen(): Use -I <dir> according to the list by include_directories().
For now, local_tds and global_tds are integrated to dependent_tds.

llvm-svn: 200150
2014-01-26 12:41:38 +00:00
NAKAMURA Takumi 93d4cda2ca [CMake] Functionalize tblgen().
llvm-svn: 200149
2014-01-26 12:41:33 +00:00
NAKAMURA Takumi 3c6f5cd446 [CMake] configure_lit_site_cfg: ${SHLIBDIR} should point the build tree.
llvm-svn: 200134
2014-01-26 06:18:56 +00:00
Chandler Carruth f4144ad23a Don't clobber CMAKE_REQUIRED_FLAGS, it ends up being used in
C compilations as well and these flags don't make any sense there.

llvm-svn: 199756
2014-01-21 18:09:19 +00:00
Amara Emerson 5569381aed Fix VS2012 ID/version check.
llvm-svn: 199753
2014-01-21 16:41:07 +00:00
Evgeniy Stepanov 131585a6f5 Fix libstdc++4.7 test on Android.
llvm-svn: 199714
2014-01-21 09:00:30 +00:00
NAKAMURA Takumi db2a4af37f [CMake] LLVMProcessSources.cmake: Add include(CMakeParseArguments).
I didn't realize that cmake_parse_arguments() would require explicit inclusion.

llvm-svn: 199674
2014-01-20 17:05:49 +00:00
NAKAMURA Takumi 6acf320a99 [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.
ADDITIONAL_HEADERS is intended to add header files for IDEs as hint.

For example:
  add_llvm_library(LLVMSupport
    Host.cpp
    ADDITIONAL_HEADERS
      Unix/Host.inc
      Windows/Host.inc
    )

llvm-svn: 199639
2014-01-20 10:20:23 +00:00
NAKAMURA Takumi ce78b80eea [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).

llvm-svn: 199595
2014-01-19 12:52:10 +00:00
NAKAMURA Takumi 95d41dca93 [CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.
llvm-svn: 199592
2014-01-19 12:47:18 +00:00
Chandler Carruth f8f0015b45 Add the test for libstdc++ versions newer than 4.6 so we don't
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.

llvm-svn: 199484
2014-01-17 09:47:55 +00:00
Quentin Colombet cb2ae8d8f7 [cmake] Attempt to fix sanitizer buildbot.
The generation of the native_export_file end up in
several different makefiles. All those makefiles
write the same file, but can be executed concurrently...
and bad things happen!

llvm-svn: 199356
2014-01-16 06:43:55 +00:00
Chandler Carruth 8388597361 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.

llvm-svn: 199149
2014-01-13 22:21:34 +00:00
Chandler Carruth 24b40f59da Add a check that the host compiler is modern to CMake, take 1. This is
likely to be reverted and re-applied a few times. The minimum versions
we're aiming at:

  GCC 4.7
  Clang 3.1
  MSVC 17.0 (Visual Studio 2012)

Let me know if something breaks!

llvm-svn: 199145
2014-01-13 21:47:35 +00:00
NAKAMURA Takumi 9668890568 [CMake] Add a comment to tablegen's copy_if_different. Ninja reports every action by default.
llvm-svn: 199058
2014-01-12 17:42:43 +00:00
Alp Toker c0b7bb56db CMake: Provide LLVM_PLUGIN_EXT definition
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.

llvm-svn: 198746
2014-01-08 11:10:24 +00:00
NAKAMURA Takumi e42fd0d34d [CMake] Introduce llvm_update_compile_flags(target_name) to update compile flags in target properties.
FIXME: Just add_unittest() is using it.
FIXME: Cooperate with source properties.
llvm-svn: 198683
2014-01-07 10:24:14 +00:00
Jean-Daniel Dupas edad1b4797 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

llvm-svn: 198625
2014-01-06 18:27:27 +00:00
Nico Weber 34bac1f730 Add a FIXME.
llvm-svn: 198528
2014-01-05 00:37:45 +00:00
Jordan Rose 353bdcde90 [CMake] Add missing set_output_directory after Takumi's change in r198205.
Plugins need to go in build/Debug/lib as well (rather than build/lib/Debug).

Also, fix the SHLIBDIR path for Xcode, which by default includes Xcode build
settings rather than a simple %(build_mode)s parameter.

llvm-svn: 198344
2014-01-02 19:47:45 +00:00
Douglas Gregor bbebd81709 CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.
llvm-svn: 198335
2014-01-02 19:07:19 +00:00
Douglas Gregor df34b13e9f Remove CMake-Xcode hack that symlinked llvm-config into a common place.
When building Clang separately from LLVM with CMake, one should set
the path of llvm-config via the cache variable LLVM_CONFIG.

llvm-svn: 198316
2014-01-02 16:30:55 +00:00
NAKAMURA Takumi baa9f533fe [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.
llvm-svn: 198205
2013-12-30 06:48:30 +00:00
Yaron Keren 03759bd9c0 Visual C++ does not support -ffunction-sections -fdata-sections.
llvm-svn: 198203
2013-12-30 05:31:53 +00:00
Nico Weber 62588e1a86 Port r198087 and r198089 (strip dead code by default) from make to cmake.
llvm-svn: 198198
2013-12-30 03:36:05 +00:00
Nico Weber dc78dc9ac6 [cmake] In add_llvm_loadable_module, don't clobber existing LINK_FLAGS on OS X.
Also add leading spaces to the LINK_FLAGS setters, since that's what the cmake
folks recommend: http://www.cmake.org/pipermail/cmake/2012-October/052399.html

llvm-svn: 198182
2013-12-29 23:04:48 +00:00
NAKAMURA Takumi faabd7cf37 Fix mis-merging in AddLLVM.cmake, take #2. LINK.EXE's options had been broken. Sorry again.
llvm-svn: 198169
2013-12-29 16:50:15 +00:00
NAKAMURA Takumi 0a062bd225 Fix mis-merging in AddLLVM.cmake. Sorry.
llvm-svn: 198166
2013-12-29 16:19:13 +00:00
NAKAMURA Takumi 14d09b872f [CMake] Fix add_llvm_loadble_module.
Thanks to Edward-san, to let me know.

llvm-svn: 198165
2013-12-29 16:15:31 +00:00
NAKAMURA Takumi bbd2aaa257 [CMake] add_llvm_symbol_exports: Use unique name for each target.
llvm-svn: 198164
2013-12-29 16:15:26 +00:00
NAKAMURA Takumi 812107527c [CMake] add_llvm_symbol_exports: Use ${native_export_file} instead of equivalent constant "symbol.*', since it is defined.
llvm-svn: 198163
2013-12-29 16:15:18 +00:00
Nico Weber 49d6f485ce Yet another attempt at getting cmake-clang-i686-mingw32 green.
llvm-svn: 198159
2013-12-29 07:43:09 +00:00
Nico Weber 49da758cbf Windows build fixes, hopefully last part.
r198153 fixed the msvs bot problem, but broke a msysgit bot. This change
hopefully makes both variants happy.

llvm-svn: 198156
2013-12-29 06:56:28 +00:00
Nico Weber 1946f3a01b Another windows build fix attempt.
Inspired by http://public.kitware.com/pipermail/cmake-developers/2012-March/003768.html

llvm-svn: 198153
2013-12-29 06:12:40 +00:00
Nico Weber 06473f855d More windows build fix attempts.
The windows ninja build is now green, but msvs is still unhappy. Maybe that's
because the .def file was passed when building LTO_static, so only pass
symbol lists for shared libraries.

llvm-svn: 198151
2013-12-29 05:39:01 +00:00
Nico Weber 5c8a4a3e3e The same we do every commit, Pinky: Try to fix the windows build (after r198136).
llvm-svn: 198148
2013-12-29 04:05:23 +00:00
Nico Weber 35ea47d0d2 Another windows build fix attempt after r198136.
The current quoting is stripped by cmake, try quoting more.

llvm-svn: 198143
2013-12-29 00:50:09 +00:00
Nico Weber 2534017ad1 Try to fix windows build more after r198136.
The command that cmd.exe is complaining about is:
cmd.exe /c cd /D C:\bb-win7\cmake-clang-i686-mingw32\build\tools\lto && cmake -E echo EXPORTS > symbol.def && type C:/bb-win7/cmake-clang-i686-mingw32/llvm-project/llvm/tools/lto/lto.exports >> symbol.def

Maybe quoting the filename helps.

llvm-svn: 198140
2013-12-29 00:27:49 +00:00
Nico Weber b42359d74b Use `${CMAKE_COMMAND}` instead of `cmake`.
llvm-svn: 198139
2013-12-29 00:11:20 +00:00
Nico Weber fc9ddcde82 Try to fix windows build after r198136.
`type` can't read from stdin.

llvm-svn: 198138
2013-12-28 23:50:01 +00:00
Nico Weber a69d1a88a6 Try to fix linux build after r198136.
$ needs to be written $$ in makefiles, but not in cmakefiles.

llvm-svn: 198137
2013-12-28 23:39:49 +00:00
Nico Weber c27118ddb6 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.

llvm-svn: 198136
2013-12-28 23:31:44 +00:00
Nico Weber d16b48a203 Remove windows newlines.
llvm-svn: 198135
2013-12-28 23:26:51 +00:00
Alp Toker 171b0c36a3 Fix documentation typos
llvm-svn: 197757
2013-12-20 00:33:39 +00:00
NAKAMURA Takumi 69a89c7849 Revert r197682, "[CMake] Introduce LIT in add_lit_target."
llvm-svn: 197703
2013-12-19 17:11:08 +00:00
NAKAMURA Takumi 716198d61c [CMake] Introduce LIT in add_lit_target.
llvm-svn: 197682
2013-12-19 16:02:17 +00:00
Jordan Rose b96aae233c [CMake] Don't put every project's tblgen executable in the LLVM bin directory.
This changes Clang standalone builds so that clang-tblgen lives in
clang/build/bin instead of llvm/build/bin, and so that with the Xcode
generator it's in clang/build/bin/Debug instead of llvm/build/bin/Debug/Debug/.
Yes, really.

llvm-svn: 197590
2013-12-18 17:50:33 +00:00
NAKAMURA Takumi 0adf24a02d [CMake] Prune LLVM_TOOLS_BINARY_DIR in LLVMConfig.cmake, since it always points build directory.
llvm-svn: 197581
2013-12-18 15:57:58 +00:00
NAKAMURA Takumi 76f4f3809d [CMake] ${LLVM_MAIN_SRC_DIR}/include can be represented as ${LLVM_MAIN_INCLUDE_DIR}.
llvm-svn: 197396
2013-12-16 16:14:19 +00:00
NAKAMURA Takumi e73df85038 [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}

llvm-svn: 197394
2013-12-16 16:03:08 +00:00
NAKAMURA Takumi 0dc10d55da [CMake] add_lit_target: Let lit.site.cfg free from "--param build_mode" on single configuration builds, like autoconf build.
llvm-svn: 196377
2013-12-04 11:15:17 +00:00
NAKAMURA Takumi 03fc730c3c [CMake] add_lit_target: Tests should be excluded from "Build Solution".
llvm-svn: 196093
2013-12-02 11:31:19 +00:00
NAKAMURA Takumi 226e10edff [CMake] Let add_public_tablegen_target() provide intrinsics_gen, too.
I think, in principle, intrinsics_gen may be added explicitly.
That said, it can be added incidentally, since each target already has dependencies to llvm-tblgen.
Almost all source files depend on both CommonTaleGen and intrinsics_gen.

Explicit add_dependencies() have been pruned under lib/Target.

llvm-svn: 195929
2013-11-28 17:04:31 +00:00
NAKAMURA Takumi ce746c6c49 [CMake] Let add_public_tablegen_target responsible to provide dependency to CommonTableGen.
add_public_tablegen_target adds *CommonTableGen to LLVM_COMMON_DEPENDS.
LLVM_COMMON_DEPENDS affects add_llvm_library (and other add_target stuff) within its scope.

llvm-svn: 195927
2013-11-28 17:04:04 +00:00
Arnaud A. de Grandmaison b697b538dc 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.

llvm-svn: 195727
2013-11-26 10:33:53 +00:00
Hans Wennborg 4656ec1e70 Revert my CMake patches concerning building with /MT (r194589, r194596)
Reid pointed out we already have LLVM_USE_CRT_{buildtype} to set it.

llvm-svn: 194604
2013-11-13 20:29:10 +00:00
Hans Wennborg fc59812bee 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.

llvm-svn: 194596
2013-11-13 19:12:02 +00:00
Hans Wennborg 079cb9b3e5 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

llvm-svn: 194589
2013-11-13 18:16:23 +00:00
Yaron Keren 9ea4ea56d1 Remove NDBEUG from all release types compile flags.
llvm-svn: 193031
2013-10-19 07:30:37 +00:00
Hans Wennborg bef50abea9 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.

llvm-svn: 192912
2013-10-17 18:39:47 +00:00
Hans Wennborg fd541f001b 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!

llvm-svn: 192904
2013-10-17 17:49:57 +00:00
Hans Wennborg 3e67a65729 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

llvm-svn: 192139
2013-10-07 22:03:23 +00:00
David Majnemer 61eae2e30c Revert "Revert "Windows: Add support for unicode command lines""
This reverts commit r192070 which reverted r192069, I forgot to
regenerate the configure scripts.

llvm-svn: 192079
2013-10-07 01:00:07 +00:00
David Majnemer f636cf422e Revert "Windows: Add support for unicode command lines"
This is causing MinGW bots to fail.
This reverts commit r192069.

llvm-svn: 192070
2013-10-06 20:44:34 +00:00
David Majnemer 80bea0c315 Windows: Add support for unicode command lines
Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name.  Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.

This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
 - It doesn't work on cygwin.
 - It only work on MinGW with caveats and only then on certain versions.
 - We get to keep our entry point as main(). :)

N.B.  This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G.  clang spawning clang -cc1 would want to give it Unicode arguments.

Reviewers: aaron.ballman, Bigcheese, rnk, ruiu

Reviewed By: rnk

CC: llvm-commits, ygao

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

llvm-svn: 192069
2013-10-06 20:25:49 +00:00
Rafael Espindola 8cc523f5f7 Reverts commit r190808 and r190556.
The use of these features in clang has been reverted.

llvm-svn: 191785
2013-10-01 17:40:47 +00:00
Jordan Rose 66ea0363e4 [CMake] Hack GetSVN.cmake to handle unusual terminals.
I got a report of a hang in git's helper functions trying to figure out
how to display results of "git svn info" when run inside ninja, even though
the result is immediately piped to grep. This seems to avoid that.

llvm-svn: 190808
2013-09-16 21:38:01 +00:00
Alexey Samsonov 9c0748a90c Fixup for r190409: add dep on LZMA only if CMake is cross-compiling
llvm-svn: 190591
2013-09-12 08:26:53 +00:00
Jordan Rose 04801d549a [CMake] Update GetSVN.cmake to use LLVM version control helper scripts.
This allows the logic to work with Git, and also uses the variable names
to match what Clang is actually looking for.

This changes the interface of GetSVN.cmake. Clang change to follow.

llvm-svn: 190556
2013-09-11 22:46:41 +00:00
NAKAMURA Takumi 7230246d14 config-ix.cmake: Tweak stray endif(...) to suppress a warning in CMake.
llvm-svn: 190502
2013-09-11 09:42:03 +00:00
Hans Wennborg bac9d13647 cmake: Install llvm-tblgen again
It was removed in r189130, but it turns out this makes life hard for
folks packaging LLVM and Clang and building the latter based on the
LLVM package.

Note that this only adds back the LLVM tblgen, and it's obviously
not included when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

llvm-svn: 190419
2013-09-10 18:35:14 +00:00
Renato Golin 74c652eb3f Adding LZMA as dep for XML2 on 2.8.0 or higher
LibXML2 config doesn't specify lzma as a dependency, which breaks
cross-compilation builds using new linkers (ld 2.21 or higher).

There is a bug on libxml2 to fix that, but since it's going to take
a while for things to go round and back, so we should have a harmless
addition of the library until then.

llvm-svn: 190409
2013-09-10 14:24:17 +00:00
Alexey Samsonov f9ab351b8a [CMake] Add -O1 in debug builds with LLVM_USE_SANITIZER
llvm-svn: 189747
2013-09-02 09:15:01 +00:00