summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* Reformat.NAKAMURA Takumi2015-01-061-2/+4
| | | | llvm-svn: 225259
* [go] Teach the go cmake build functions to funnel the include directories ↵Chandler Carruth2014-12-291-1/+6
| | | | | | | | | | | | | | down into the cgo-setup variables of llvm-go. Summary: This in turn allows us to use #includes with cgo that rely on CMake provided include directories which is particularly useful for handling generated headers that aren't reasonable to put in an "installable" location. Differential Revision: http://reviews.llvm.org/D6798 llvm-svn: 224962
* Disable --icf=safe to avoid a bug.Rafael Espindola2014-12-121-1/+3
| | | | | | Thanks to Sameer Sahasrabuddhe for the report! llvm-svn: 224123
* Also use --icf=safe if we are being linked by gold.Rafael Espindola2014-12-041-1/+1
| | | | llvm-svn: 223394
* Detect if the linker is gold and if so always use --gc-sections.Rafael Espindola2014-12-041-1/+15
| | | | llvm-svn: 223372
* Teach LLVM about llgo subproject.Peter Collingbourne2014-11-271-0/+25
| | | | llvm-svn: 222860
* CMake: Use the new USES_TERMINAL option for test suite targets when available.Peter Collingbourne2014-11-171-0/+1
| | | | llvm-svn: 222181
* Pass PRIVATE to target_link_libraries if using shared libraries.Rafael Espindola2014-11-071-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A shared library (unlike a .a), has its dependencies recorded in the library and we can pass PRIVATE to target_link_libraries. This patch then removes some bogus dependencies when using BUILD_SHARED_LIBS=ON. For example, we go from build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o: CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp || include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so lib/libLLVMCore.so lib/libLLVMBitReader.so lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so lib/libLLVMTarget.so lib/libLLVMProfileData.so to build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o: CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp || include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so lib/libLLVMCore.so lib/libLLVMTransformUtils.so lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so lib/libLLVMTarget.so In fact, build.ninja goes from 5231028 bytes to 4896759 bytes. With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus warning when building with BUILD_SHARED_LIBS. llvm-svn: 221530
* [cmake] Pass -O3 when linking.Rafael Espindola2014-11-021-4/+11
| | | | | | Gold and bfd ld enable misc optimizations. lld ignores the option for now. llvm-svn: 221097
* EXPORTED_SYMBOL_FILE using mingw and cmakeChris Bieneman2014-10-301-13/+15
| | | | | | | | | | | | | | | | Summary: This is a fix for the command line syntax error while building LTO when using MinGW. Patch By: jsroemer Reviewers: rnk Reviewed By: rnk Subscribers: rnk, beanz, llvm-commits Differential Revision: http://reviews.llvm.org/D5476 llvm-svn: 220935
* Teach lit to filter the host LDFLAGS down from the build system and intoChandler Carruth2014-10-211-0/+1
| | | | | | | | | | the CGO build environment. This lets things like -rpath propagate down to the C++ code that is built along side the Go bindings when testing them. Patch by Peter Collingbourne, and verified that it works by me. llvm-svn: 220252
* Explain why we don't always use --gc-sections.Rafael Espindola2014-10-201-0/+4
| | | | llvm-svn: 220237
* Revert r220174, "Always use -Wl,-gc-sections on our build."NAKAMURA Takumi2014-10-201-9/+6
| | | | | | | | | | | | | | | | | | It dropped required functions for plugins with gnu ld 2.20 and 2.21. Failing Tests (1): LLVM :: Feature/load_module.ll Hello: bin/opt: symbol lookup error: lib/LLVMHello.so: undefined symbol: _ZN4llvm11raw_ostream13write_escapedENS_9StringRefEb Failing Tests (1): Clang :: Frontend/plugins.c error: unable to load plugin 'lib/PrintFunctionNames.so': 'lib/PrintFunctionNames.so: undefined symbol: _ZN5clang15PluginASTAction6anchorEv' I think we should inspect linker's version or behavior to introduce --gc-sections for --export-dynamic. llvm-svn: 220198
* Always use -Wl,-gc-sections on our build.Rafael Espindola2014-10-191-6/+9
| | | | | | | Both bfd ld and gold correctly handle --export-dynamic, so gc-sections is safe even for binaries that support plugins. llvm-svn: 220174
* Disable ccache for go tests.Peter Collingbourne2014-10-171-2/+2
| | | | | | Should fix llvm-clang-lld-x86_64-debian-fast bot. llvm-svn: 220071
* Initial version of Go bindings.Peter Collingbourne2014-10-161-0/+3
| | | | | | | | | | | | This code is based on the existing LLVM Go bindings project hosted at: https://github.com/go-llvm/llvm Note that all contributors to the gollvm project have agreed to relicense their changes under the LLVM license and submit them to the LLVM project. Differential Revision: http://reviews.llvm.org/D5684 llvm-svn: 219976
* Add LLVM_ENABLE_MODULES flag to CMake to enable building with C++ modules.Richard Smith2014-09-261-0/+12
| | | | llvm-svn: 218551
* Added LLVM_ENABLE_RTTI and LLVM_ENABLE_EH options that allow RTTI and EHDan Liew2014-07-221-3/+10
| | | | | | | | to globally be controlled. Individual targets (e.g. ExceptionDemo) can still override this by using LLVM_REQUIRE_RTTI and LLVM_REQUIRE_EH if they need to be compiled with RTTI or exception handling respectively. llvm-svn: 213663
* Revert "Revert "Move clang feature flags settings out of LLVM core and into ↵Alp Toker2014-07-141-16/+0
| | | | | | | | | | cfe"" It turns out this commit was fine. The problem was in the legacy build system (fixed r213010). This reverts commit r213005. llvm-svn: 213015
* Revert "Move clang feature flags settings out of LLVM core and into cfe"Alp Toker2014-07-141-0/+16
| | | | | | | | | This broke one of the builds, presumably side-by-side modular CMake. Investigating. This reverts commit r212998. llvm-svn: 213005
* Move clang feature flags settings out of LLVM core and into cfeAlp Toker2014-07-141-16/+0
| | | | | | | clang r212997 incorporated these settings into its own build system. They no longer need to be set from LLVM. llvm-svn: 212998
* [CMake][Win32.DLL] Let llvm_add_library(SHARED) link dependent libraries as ↵NAKAMURA Takumi2014-07-141-0/+7
| | | | | | | | | | | | | | 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
* [CMake] Introduce moddir for MODULE -- corresponding to ↵NAKAMURA Takumi2014-07-131-3/+18
| | | | | | | | | | 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
* [CMake] add_llvm_library: Add "RUNTIME DESTINATION bin" to install(). It ↵NAKAMURA Takumi2014-07-111-0/+1
| | | | | | affects add_library(SHARED) for Win32.DLL. llvm-svn: 212818
* [CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. ↵NAKAMURA Takumi2014-07-041-8/+8
| | | | | | | | | | | 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
* [CMake] Introduce LLVM_SHLIB_OUTPUT_INTDIR.NAKAMURA Takumi2014-07-041-1/+1
| | | | | | For now, its user is configure_lit_site_cfg(). llvm-svn: 212314
* [CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.NAKAMURA Takumi2014-07-041-0/+5
| | | | llvm-svn: 212313
* Use llvm-lit if LLVM source tree is unavailable.Greg Fitzgerald2014-05-211-5/+6
| | | | llvm-svn: 209308
* AddLLVM: Mute the prefix "lib" in SHARED on win32.NAKAMURA Takumi2014-04-101-0/+5
| | | | | | | - LLVMSupport.dll - libLLVMSupport.dll.a llvm-svn: 205969
* [CMake] add_llvm_target(): No need to include TABLEGEN_OUTPUT in source list.NAKAMURA Takumi2014-03-041-1/+1
| | | | llvm-svn: 202862
* With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola2014-02-281-10/+0
| | | | llvm-svn: 202510
* [CMake] llvm_add_library(SHARED|STATIC): Fix broken OUTPUT_NAME for *_static.NAKAMURA Takumi2014-02-281-1/+1
| | | | llvm-svn: 202454
* [CMake] Work around to use target_link_libraries(PUBLIC) in ↵NAKAMURA Takumi2014-02-261-0/+7
| | | | | | | BUILD_SHARED_LIBS mode. FIXME: It may be PRIVATE since SO knows its dependent libs. llvm-svn: 202261
* [CMake] Move LLVMBUILD_LIB_DEPS stuff from add_llvm_library (and ↵NAKAMURA Takumi2014-02-261-13/+30
| | | | | | LLVm-Config) to llvm_add_library to centralize target_link_libraries. llvm-svn: 202260
* [CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to ↵NAKAMURA Takumi2014-02-261-2/+7
| | | | | | | | | | | | | | | | | | 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
* Prune debug message in AddLLVM.cmake.NAKAMURA Takumi2014-02-221-1/+0
| | | | llvm-svn: 201932
* [CMake] llvm_add_library: Add dependencies also to objlibs as workaround of ↵NAKAMURA Takumi2014-02-211-0/+13
| | | | | | | | CMake issue 14747. http://www.cmake.org/Bug/view.php?id=14747 llvm-svn: 201855
* [CMake] Introduce "llvm_add_library(SHARED STATIC)" to build both shared lib ↵NAKAMURA Takumi2014-02-211-2/+36
| | | | | | | | | | | | | | 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
* [CMake] Let llvm_add_library(MODULE) check capability of loadable module.NAKAMURA Takumi2014-02-131-6/+10
| | | | | | | 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
* [CMake] Move the target property PREFIX from add_llvm_loadable_module() to ↵NAKAMURA Takumi2014-02-131-2/+4
| | | | | | llvm_add_library(). llvm-svn: 201318
* [CMake] llvm_add_library(MODULE) may use CMAKE_MODULE_LINKER_FLAGS instead ↵NAKAMURA Takumi2014-02-131-6/+0
| | | | | | | | of target property LINK_FLAGS. I mis-dropped Darwin's link flags (in clang side) since r201073. llvm-svn: 201317
* [CMake] llvm_add_library: Add handling of the parameter ADDITIONAL_HEADERS ↵NAKAMURA Takumi2014-02-131-3/+7
| | | | | | | | | | | 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
* [CMake] LLVMSupport should be responsible to provide system_libs.NAKAMURA Takumi2014-02-101-5/+0
| | | | llvm-svn: 201077
* [CMake] Introduce llvm_add_library().NAKAMURA Takumi2014-02-101-25/+75
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Export lib and exe build target names from build treeNAKAMURA Takumi2014-02-091-0/+5
| | | | | | | | | | | | | | | 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
* Export lib and exe build target names from install treeNAKAMURA Takumi2014-02-091-1/+5
| | | | | | | | | | | | | | | 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
* [CMake] add_llvm_loadable_module: Fixup r200762, I mis-eliminated wrong line. :(NAKAMURA Takumi2014-02-041-0/+1
| | | | llvm-svn: 200763
* Revert r122395, "Fixes file extension for loadable modules on OS X."NAKAMURA Takumi2014-02-041-8/+1
| | | | | | | | | 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
* AddLLVM.cmake: Untabify.NAKAMURA Takumi2014-01-311-2/+2
| | | | llvm-svn: 200557
* [CMake] llvm_update_compile_flags: Honor LLVM_COMPILE_FLAGS.NAKAMURA Takumi2014-01-301-5/+10
| | | | | | I accidentally mis-dropped LLVM_COMPILE_FLAGS in r200301. Sorry for that. llvm-svn: 200499
OpenPOWER on IntegriCloud