1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

149 Commits

Author SHA1 Message Date
NAKAMURA Takumi
db3003f585 [CMake][Win32.DLL] Let llvm_add_library(SHARED) link dependent libraries as PRIVATE.
For example, c-index-test.exe requires just libclang.dll (its import library).
When libraries in libclang were not PRIVATE but PUBLIC, c-index-test required libraries transitive by libclang.

Note, on mingw with BUILD_SHARED_LIBS, library dependencies would become more strict.
In principle, required libraries should be "required in its source file".

This will help to detect missing dependencies.

llvm-svn: 212934
2014-07-14 12:26:15 +00:00
NAKAMURA Takumi
64baaaeb1d [CMake] Introduce moddir for MODULE -- corresponding to LIBRARY_OUTPUT_DIRECTORY.
On Win32.DLL, it points not lib but bin.

LIBRARY_OUTPUT_DIRECTORY affects add_library(MODULE), especially Win32.DLL.

llvm-svn: 212903
2014-07-13 13:33:26 +00:00
NAKAMURA Takumi
dc7f1673bc [CMake] add_llvm_library: Add "RUNTIME DESTINATION bin" to install(). It affects add_library(SHARED) for Win32.DLL.
llvm-svn: 212818
2014-07-11 14:36:28 +00:00
NAKAMURA Takumi
bf702649e3 [CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. BUILD_SHARED_LIBS may not control enable/disable plugins.
FIXME: Make this configurable.

FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for plugins. We may rename it.
I introduced config.enable_shared in r120273.

llvm-svn: 212315
2014-07-04 04:45:40 +00:00
NAKAMURA Takumi
d4a2660a3f [CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.
For now, its user is configure_lit_site_cfg().

llvm-svn: 212314
2014-07-04 04:23:26 +00:00
NAKAMURA Takumi
70940ab6b9 [CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.
llvm-svn: 212313
2014-07-04 04:23:15 +00:00
Greg Fitzgerald
7350e4eb4e Use llvm-lit if LLVM source tree is unavailable.
llvm-svn: 209308
2014-05-21 16:44:03 +00:00
NAKAMURA Takumi
36ac722655 AddLLVM: Mute the prefix "lib" in SHARED on win32.
- LLVMSupport.dll
  - libLLVMSupport.dll.a

llvm-svn: 205969
2014-04-10 15:47:04 +00:00
NAKAMURA Takumi
fe3f2dd435 [CMake] add_llvm_target(): No need to include TABLEGEN_OUTPUT in source list.
llvm-svn: 202862
2014-03-04 17:05:28 +00:00
Rafael Espindola
28ea255db4 With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.
llvm-svn: 202510
2014-02-28 16:16:51 +00:00
NAKAMURA Takumi
3b56287ef6 [CMake] llvm_add_library(SHARED|STATIC): Fix broken OUTPUT_NAME for *_static.
llvm-svn: 202454
2014-02-28 00:28:13 +00:00
NAKAMURA Takumi
84469264f9 [CMake] Work around to use target_link_libraries(PUBLIC) in BUILD_SHARED_LIBS mode.
FIXME: It may be PRIVATE since SO knows its dependent libs.
llvm-svn: 202261
2014-02-26 11:58:11 +00:00
NAKAMURA Takumi
60bccb6382 [CMake] Move LLVMBUILD_LIB_DEPS stuff from add_llvm_library (and LLVm-Config) to llvm_add_library to centralize target_link_libraries.
llvm-svn: 202260
2014-02-26 11:58:01 +00:00
NAKAMURA Takumi
7442e7c058 [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build.
target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library,
although final targets have dependencies to whole dependent libraries.
It makes most libraries can be built in parallel.

target_link_libraries(PRIVATE) is used to shaared library.
Each dependent library is linked to the target.so, and its user will not see its grandchildren.
For example,

  - libclang.so has sufficient libclang*.a(s).
  - c-index-test requires just only libclang.so.

FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing.
llvm-svn: 202241
2014-02-26 06:53:16 +00:00
NAKAMURA Takumi
51968a2f24 Prune debug message in AddLLVM.cmake.
llvm-svn: 201932
2014-02-22 07:31:10 +00:00
NAKAMURA Takumi
6a54b7cd10 [CMake] llvm_add_library: Add dependencies also to objlibs as workaround of CMake issue 14747.
http://www.cmake.org/Bug/view.php?id=14747

llvm-svn: 201855
2014-02-21 14:17:29 +00:00
NAKAMURA Takumi
9290e6a3f3 [CMake] Introduce "llvm_add_library(SHARED STATIC)" to build both shared lib and static lib simulataneously.
llvm_add_library(foo SHARED STATIC
    DEPENDS <dependent targets...>
    LINK_LIBS <required libraries...>
    )

It generates both foo (foo.so) and foo_static(foo.a) and both of them depend on DEPENDS and LINK_LIBS.
Then, also obj.foo is generated. obj.foo depends on DEPENDS, but doesn't depend on LINK_LIBS.

llvm-svn: 201854
2014-02-21 14:17:17 +00:00
NAKAMURA Takumi
bec7f62e98 [CMake] Let llvm_add_library(MODULE) check capability of loadable module.
On unsupported platforms, llvm_add_library(MODULE) doesn't create any targets.
Caller may be responsible to check and add extra target properties.

llvm-svn: 201320
2014-02-13 11:25:17 +00:00
NAKAMURA Takumi
f29c091bdb [CMake] Move the target property PREFIX from add_llvm_loadable_module() to llvm_add_library().
llvm-svn: 201318
2014-02-13 11:19:21 +00:00
NAKAMURA Takumi
0586905e99 [CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS instead of target property LINK_FLAGS.
I mis-dropped Darwin's link flags (in clang side) since r201073.

llvm-svn: 201317
2014-02-13 11:19:11 +00:00
NAKAMURA Takumi
1cff87e287 [CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HEADERS to pass through to process_source.
I was insightless then about unknown optional parameters.
(Consider that LINK_LIBS foo bar ADDITIONAL_HEADERS qux quux)

Suggested by Michael Kruse. Thanks!

llvm-svn: 201283
2014-02-13 01:00:52 +00:00
NAKAMURA Takumi
ad172d26af [CMake] LLVMSupport should be responsible to provide system_libs.
llvm-svn: 201077
2014-02-10 10:52:19 +00:00
NAKAMURA Takumi
f83fca5f7a [CMake] Introduce llvm_add_library().
- MODULE;SHARED;STATIC
      STATIC by default w/o BUILD_SHARED_LIBS.
      SHARED by default w/  BUILD_SHARED_LIBS.
  - OUTPUT_NAME name
      Corresponds to OUTPUT_NAME in target properties.
  - DEPENDS targets...
      Same semantics as add_dependencies().
  - LINK_COMPONENTS components...
      Same as the variable LLVM_LINK_COMPONENTS.
  - LINK_LIBS lib_targets...
      Same semantics as target_link_libraries().
  - ADDITIONAL_HEADERS (implemented in LLVMProcessSources)
      May specify header files for IDE generators.

I suggest llvm_add_library() may be used for inter-project add_library stuff
and also suggest add_***_library() may be used project-specific.

Please be patient that llvm_add_library might be ambiguous against add_llvm_library.

llvm-svn: 201072
2014-02-10 09:05:11 +00:00
NAKAMURA Takumi
0cff33c584 Export lib and exe build target names from build tree
Record every logical target that we install with install(TARGETS) in a
global LLVM_EXPORTS property.  Then use the export(TARGETS) command to
provide a "LLVMExports.cmake" file that exports logical targets for
import into applications directly from our build tree.

The "LLVMExports.cmake" file is not meant for direct inclusion by
application code but should be included by "LLVMConfig.cmake" in a
future change.

Contributed by Brad King.

llvm-svn: 201050
2014-02-09 16:36:16 +00:00
NAKAMURA Takumi
4994e358f4 Export lib and exe build target names from install tree
Use the install(TARGETS) command EXPORT option for every library and
executable that we install with LLVM.  Then use the install(EXPORT)
command to provide a "LLVMExports.cmake" file that exports logical
targets for import into applications from our install tree.

The "LLVMExports.cmake" file is not meant for direct inclusion by
application code but should be included by "LLVMConfig.cmake" in a
future change.

Contributed by Brad King.

llvm-svn: 201049
2014-02-09 16:36:03 +00:00
NAKAMURA Takumi
13fe883ef7 [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
6c5c626389 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
NAKAMURA Takumi
0758e83e9b AddLLVM.cmake: Untabify.
llvm-svn: 200557
2014-01-31 17:32:42 +00:00
NAKAMURA Takumi
17cbd6841a [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
d6ac1d50c8 [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
806bce066e [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
96ebbdc8e5 [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
b340d5771b [CMake] Put *_exports into "Misc" folder.
llvm-svn: 200228
2014-01-27 17:39:38 +00:00
NAKAMURA Takumi
937fce3653 [CMake] configure_lit_site_cfg: ${SHLIBDIR} should point the build tree.
llvm-svn: 200134
2014-01-26 06:18:56 +00:00
NAKAMURA Takumi
9bbe4b2609 [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
45c99b48b7 [CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.
llvm-svn: 199592
2014-01-19 12:47:18 +00:00
Quentin Colombet
a367ea144b [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
Alp Toker
8a5e4a35de 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
ed96e58eb4 [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
Nico Weber
3518d8057f Add a FIXME.
llvm-svn: 198528
2014-01-05 00:37:45 +00:00
Jordan Rose
9ac10ba363 [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
832dac5597 CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.
llvm-svn: 198335
2014-01-02 19:07:19 +00:00
NAKAMURA Takumi
6c726f53f1 [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
a4b492b93c Visual C++ does not support -ffunction-sections -fdata-sections.
llvm-svn: 198203
2013-12-30 05:31:53 +00:00
Nico Weber
e7bb9e41e0 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
751d91743e [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
887d8dcdf3 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
39599b4e25 Fix mis-merging in AddLLVM.cmake. Sorry.
llvm-svn: 198166
2013-12-29 16:19:13 +00:00
NAKAMURA Takumi
55c0c85340 [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
f0a37d5de0 [CMake] add_llvm_symbol_exports: Use unique name for each target.
llvm-svn: 198164
2013-12-29 16:15:26 +00:00