summaryrefslogtreecommitdiff
path: root/cmake/modules/AddLLVM.cmake
Commit message (Collapse)AuthorAge
* Use llvm-lit if LLVM source tree is unavailable.Greg Fitzgerald2014-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209308 91177308-0d34-0410-b5e6-96231b3b80d8
* AddLLVM: Mute the prefix "lib" in SHARED on win32.NAKAMURA Takumi2014-04-10
| | | | | | | - LLVMSupport.dll - libLLVMSupport.dll.a git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205969 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_llvm_target(): No need to include TABLEGEN_OUTPUT in source list.NAKAMURA Takumi2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202862 91177308-0d34-0410-b5e6-96231b3b80d8
* With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202510 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_add_library(SHARED|STATIC): Fix broken OUTPUT_NAME for *_static.NAKAMURA Takumi2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202454 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Work around to use target_link_libraries(PUBLIC) in ↵NAKAMURA Takumi2014-02-26
| | | | | | | | BUILD_SHARED_LIBS mode. FIXME: It may be PRIVATE since SO knows its dependent libs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202261 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Move LLVMBUILD_LIB_DEPS stuff from add_llvm_library (and ↵NAKAMURA Takumi2014-02-26
| | | | | | LLVm-Config) to llvm_add_library to centralize target_link_libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202260 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to ↵NAKAMURA Takumi2014-02-26
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202241 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune debug message in AddLLVM.cmake.NAKAMURA Takumi2014-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201932 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_add_library: Add dependencies also to objlibs as workaround of ↵NAKAMURA Takumi2014-02-21
| | | | | | | | CMake issue 14747. http://www.cmake.org/Bug/view.php?id=14747 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201855 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce "llvm_add_library(SHARED STATIC)" to build both shared lib ↵NAKAMURA Takumi2014-02-21
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201854 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Let llvm_add_library(MODULE) check capability of loadable module.NAKAMURA Takumi2014-02-13
| | | | | | | On unsupported platforms, llvm_add_library(MODULE) doesn't create any targets. Caller may be responsible to check and add extra target properties. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201320 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Move the target property PREFIX from add_llvm_loadable_module() to ↵NAKAMURA Takumi2014-02-13
| | | | | | llvm_add_library(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201318 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS instead ↵NAKAMURA Takumi2014-02-13
| | | | | | | | of target property LINK_FLAGS. I mis-dropped Darwin's link flags (in clang side) since r201073. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201317 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HEADERS ↵NAKAMURA Takumi2014-02-13
| | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201283 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] LLVMSupport should be responsible to provide system_libs.NAKAMURA Takumi2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201077 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce llvm_add_library().NAKAMURA Takumi2014-02-10
| | | | | | | | | | | | | | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201072 91177308-0d34-0410-b5e6-96231b3b80d8
* Export lib and exe build target names from build treeNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201050 91177308-0d34-0410-b5e6-96231b3b80d8
* Export lib and exe build target names from install treeNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201049 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_llvm_loadable_module: Fixup r200762, I mis-eliminated wrong line. :(NAKAMURA Takumi2014-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200763 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r122395, "Fixes file extension for loadable modules on OS X."NAKAMURA Takumi2014-02-04
| | | | | | | | | 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. ;) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200762 91177308-0d34-0410-b5e6-96231b3b80d8
* AddLLVM.cmake: Untabify.NAKAMURA Takumi2014-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200557 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_update_compile_flags: Honor LLVM_COMPILE_FLAGS.NAKAMURA Takumi2014-01-30
| | | | | | I accidentally mis-dropped LLVM_COMPILE_FLAGS in r200301. Sorry for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200499 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET ↵NAKAMURA Takumi2014-01-28
| | | | | | PROPERTY SOURCES has them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200311 91177308-0d34-0410-b5e6-96231b3b80d8
* [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] 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
* [CMake] Put *_exports into "Misc" folder.NAKAMURA Takumi2014-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200228 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] configure_lit_site_cfg: ${SHLIBDIR} should point the build tree.NAKAMURA Takumi2014-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200134 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce new scheme of LLVM_TOOLS_BINARY_DIR and LLVM_LIBRARY_DIRNAKAMURA Takumi2014-01-19
| | | | | | | | In LLVM build tree, they points corresponding INTDIR. In Clang standalone tree, they points external dir (llvm-config's --bindir and --libdir). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199595 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.NAKAMURA Takumi2014-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199592 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Attempt to fix sanitizer buildbot.Quentin Colombet2014-01-16
| | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199356 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
* [CMake] Introduce llvm_update_compile_flags(target_name) to update compile ↵NAKAMURA Takumi2014-01-07
| | | | | | | | | flags in target properties. FIXME: Just add_unittest() is using it. FIXME: Cooperate with source properties. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198683 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME.Nico Weber2014-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198528 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Add missing set_output_directory after Takumi's change in r198205.Jordan Rose2014-01-02
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198344 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake separate projects: use correct name for ↵Douglas Gregor2014-01-02
| | | | | | LIBRARY_OUTPUT_DIRECTORY_${suffix}. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198335 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][VS][XCode] Restruct the output directory layout more comfortable, ↵NAKAMURA Takumi2013-12-30
| | | | | | | | | | | | | | | | | | | ${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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198205 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual C++ does not support -ffunction-sections -fdata-sections.Yaron Keren2013-12-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198203 91177308-0d34-0410-b5e6-96231b3b80d8
* Port r198087 and r198089 (strip dead code by default) from make to cmake.Nico Weber2013-12-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198198 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] In add_llvm_loadable_module, don't clobber existing LINK_FLAGS on OS X.Nico Weber2013-12-29
| | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198182 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mis-merging in AddLLVM.cmake, take #2. LINK.EXE's options had been ↵NAKAMURA Takumi2013-12-29
| | | | | | broken. Sorry again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198169 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mis-merging in AddLLVM.cmake. Sorry.NAKAMURA Takumi2013-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198166 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Fix add_llvm_loadble_module.NAKAMURA Takumi2013-12-29
| | | | | | Thanks to Edward-san, to let me know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198165 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_llvm_symbol_exports: Use unique name for each target.NAKAMURA Takumi2013-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198164 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] add_llvm_symbol_exports: Use ${native_export_file} instead of ↵NAKAMURA Takumi2013-12-29
| | | | | | equivalent constant "symbol.*', since it is defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198163 91177308-0d34-0410-b5e6-96231b3b80d8
* Yet another attempt at getting cmake-clang-i686-mingw32 green.Nico Weber2013-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198159 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows build fixes, hopefully last part.Nico Weber2013-12-29
| | | | | | | | r198153 fixed the msvs bot problem, but broke a msysgit bot. This change hopefully makes both variants happy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198156 91177308-0d34-0410-b5e6-96231b3b80d8
* Another windows build fix attempt.Nico Weber2013-12-29
| | | | | | | Inspired by http://public.kitware.com/pipermail/cmake-developers/2012-March/003768.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198153 91177308-0d34-0410-b5e6-96231b3b80d8
* More windows build fix attempts.Nico Weber2013-12-29
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198151 91177308-0d34-0410-b5e6-96231b3b80d8
* The same we do every commit, Pinky: Try to fix the windows build (after ↵Nico Weber2013-12-29
| | | | | | r198136). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198148 91177308-0d34-0410-b5e6-96231b3b80d8