Commit Graph

536 Commits

Author SHA1 Message Date
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