summaryrefslogtreecommitdiff
path: root/cmake
Commit message (Collapse)AuthorAge
* cmake: Do not export targets when installing toolchain onlyReid Kleckner2014-02-10
| | | | | | Patch by Brad King! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201111 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
* [CMake] LLVMProcessSources.cmake: Prune add_file_dependencies to ↵NAKAMURA Takumi2014-02-10
| | | | | | | | | ${TABLEGEN_OUTPUT}. I am sure it'd not be required any more. In trunk, all of tablegen's users depend on ${TABLEGEN_OUTPUT} as not file dependency but inter-target dependency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201063 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Re-apply r200765, "Get rid of llvm_config() to expand dependencies."NAKAMURA Takumi2014-02-10
| | | | | | | | CMake's target_link_libraries() will manage dependencies with Brad's LLVMConfig improvements. Configuration time may be reduced by a few seconds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201062 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove shell comment in the middle of a single-line command.Bob Wilson2014-02-09
| | | | | | | You can't put a comment in the middle of a command like this. This is invalid shell syntax and breaks the build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201057 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.NAKAMURA Takumi2014-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201054 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide CMake package modules in install treeNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | | | | | | | | | | | Teach the Makefile build system to generate and install CMake modules LLVMConfig.cmake and LLVMConfigVersion.cmake so that applications that build with CMake can use 'find_package(LLVM)' even when LLVM is not built with CMake. These modules tell such applications about available LLVM libraries and their dependencies. Run llvm-config to generate the list of libraries and use the results of llvm-build to generate the library dependencies. Use sed to perform substitutions in the LLVMConfig.cmake.in and LLVMConfigVersion.cmake.in sources that our CMake build system uses. Teach the Makefile build system to generate the LLVMExports.cmake file with content similar to that produced by the CMake install(EXPORT) command. Extend llvm-build with an option to generate the library dependencies fragment for this file. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201053 91177308-0d34-0410-b5e6-96231b3b80d8
* Load exported lib and exe targets from LLVMConfigNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | | Teach each package configuration file to load the LLVMExports file for its corresponding tree. This will allow application CMake code to use logical library and executable target names from LLVM as if they were in our own build process (e.g. LLVMSupport). CMake will have enough information to propagate LLVM library link dependencies automatically while configuring applications. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201051 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
* Provide LLVMConfig in both build and install treeNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | | | | | | | Create separate package configuration files "LLVMConfig.cmake" for the LLVM build and install trees so that each can have information specific to its tree. Configure each with the corresponding include, lib, and cmake directories. Include the "LLVM-Config" API modules directly from the configured cmake modules directory. In the install tree, compute the installation prefix relative to the file location. In the build tree, provide information specific to the build tree for use by tools like Clang that can build externally against the LLVM build tree. Prefix such values in "LLVM_BUILD_" and comment them as such. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201048 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LLVMConfig to avoid modifying CMAKE_MODULE_PATHNAKAMURA Takumi2014-02-09
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201047 91177308-0d34-0410-b5e6-96231b3b80d8
* De-duplicate references to share/llvm/cmake pathNAKAMURA Takumi2014-02-09
| | | | | | | | | Use a LLVM_INSTALL_PACKAGE_DIR variable to hold the path and reference it where necessary. Contributed by Brad King. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201046 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix configure to find arc4random via header files.Todd Fiala2014-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200819 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Deliberately get all LLVM library dependencies for standalone builds.Jordan Rose2014-02-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200812 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Move -stdlib=libc++ handling into its own file.Jordan Rose2014-02-05
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200811 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Get rid of llvm_config() to expand dependencies.NAKAMURA Takumi2014-02-04
| | | | | | | | CMake's target_link_libraries() will manage dependencies. Configuration time may be reduced by a few seconds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200765 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] LLVM-Config.cmake: Split explicit_map_components_to_libraries and ↵NAKAMURA Takumi2014-02-04
| | | | | | introduce llvm_map_components_to_libnames and llvm_expand_dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200764 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
* [CMake] Revert r200695 and fix the problem with missing ↵Alexey Samsonov2014-02-04
| | | | | | -fno-function-sections in a different way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200745 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Add -stdlib=libc++ to host Clang build flags before performing any ↵Alexey Samsonov2014-02-04
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200744 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r200150, "[CMake] tablegen(): Use -I <dir> according to the list by ↵NAKAMURA Takumi2014-02-04
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200730 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use -ffunction-sections if -fno-function-sections is not supported in ↵Evgeniy Stepanov2014-02-03
| | | | | | | | | | the compiler. This will disable -ffunction-sections in older versions of Clang where it breaks build of sanitizer runtime library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200695 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Untabify.NAKAMURA Takumi2014-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200644 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce line editor library.Peter Collingbourne2014-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200595 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
* HandleLLVMOptions.cmake: Typo, s/proerty/property/NAKAMURA Takumi2014-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200556 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
* HandleLLVMOptions.cmake: Typo in comment.NAKAMURA Takumi2014-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200498 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -arm-enable-ehabi from Android build rules. It's enabled by default.Evgeniy Stepanov2014-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200391 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] Prune CMAKE_CXX_FLAGS stuff in llvm_process_sources.NAKAMURA Takumi2014-01-28
| | | | | | It is the final step to deprecate contextual CMAKE_CXX_FLAGS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200303 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] Apply -ffunction-data-sectinos not only to CMAKE_CXX_FLAGS, but also ↵NAKAMURA Takumi2014-01-28
| | | | | | to CMAKE_C_FLAGS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200300 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] Let llvm_process_sources check not only *.cpp but also *.c.NAKAMURA Takumi2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200298 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] tablegen(): Use -I <dir> according to the list by include_directories().NAKAMURA Takumi2014-01-26
| | | | | | For now, local_tds and global_tds are integrated to dependent_tds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200150 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Functionalize tblgen().NAKAMURA Takumi2014-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200149 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
* Don't clobber CMAKE_REQUIRED_FLAGS, it ends up being used inChandler Carruth2014-01-21
| | | | | | C compilations as well and these flags don't make any sense there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199756 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VS2012 ID/version check.Amara Emerson2014-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199753 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix libstdc++4.7 test on Android.Evgeniy Stepanov2014-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199714 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] LLVMProcessSources.cmake: Add include(CMakeParseArguments).NAKAMURA Takumi2014-01-20
| | | | | | I didn't realize that cmake_parse_arguments() would require explicit inclusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199674 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.NAKAMURA Takumi2014-01-20
| | | | | | | | | | | | | | 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 ) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199639 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
* Add the test for libstdc++ versions newer than 4.6 so we don'tChandler Carruth2014-01-17
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199484 91177308-0d34-0410-b5e6-96231b3b80d8