summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Whitespace.NAKAMURA Takumi2014-02-091-4/+4
| | | | llvm-svn: 201054
* Provide CMake package modules in install treeNAKAMURA Takumi2014-02-091-0/+106
| | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 201053
* Load exported lib and exe targets from LLVMConfigNAKAMURA Takumi2014-02-092-0/+6
| | | | | | | | | | | | | 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. llvm-svn: 201051
* Export lib and exe build target names from build treeNAKAMURA Takumi2014-02-093-0/+10
| | | | | | | | | | | | | | | 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-093-2/+10
| | | | | | | | | | | | | | | 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
* Provide LLVMConfig in both build and install treeNAKAMURA Takumi2014-02-092-8/+45
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 201048
* Teach LLVMConfig to avoid modifying CMAKE_MODULE_PATHNAKAMURA Takumi2014-02-092-13/+13
| | | | | | | | | | | | 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. llvm-svn: 201047
* De-duplicate references to share/llvm/cmake pathNAKAMURA Takumi2014-02-091-3/+4
| | | | | | | | | Use a LLVM_INSTALL_PACKAGE_DIR variable to hold the path and reference it where necessary. Contributed by Brad King. llvm-svn: 201046
* [CMake] Deliberately get all LLVM library dependencies for standalone builds.Jordan Rose2014-02-051-1/+7
| | | | | | | | 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. llvm-svn: 200812
* [CMake] Move -stdlib=libc++ handling into its own file.Jordan Rose2014-02-052-0/+36
| | | | | | | | | | | | | | 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. llvm-svn: 200811
* [CMake] Get rid of llvm_config() to expand dependencies.NAKAMURA Takumi2014-02-041-1/+1
| | | | | | | | CMake's target_link_libraries() will manage dependencies. Configuration time may be reduced by a few seconds. llvm-svn: 200765
* [CMake] LLVM-Config.cmake: Split explicit_map_components_to_libraries and ↵NAKAMURA Takumi2014-02-041-3/+16
| | | | | | introduce llvm_map_components_to_libnames and llvm_expand_dependencies. llvm-svn: 200764
* [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
* [CMake] Revert r200695 and fix the problem with missing ↵Alexey Samsonov2014-02-041-10/+12
| | | | | | -fno-function-sections in a different way. llvm-svn: 200745
* [CMake] Add -stdlib=libc++ to host Clang build flags before performing any ↵Alexey Samsonov2014-02-041-15/+0
| | | | | | | | | | | | 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. llvm-svn: 200744
* Revert r200150, "[CMake] tablegen(): Use -I <dir> according to the list by ↵NAKAMURA Takumi2014-02-041-17/+5
| | | | | | | | | 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. llvm-svn: 200730
* Don't use -ffunction-sections if -fno-function-sections is not supported in ↵Evgeniy Stepanov2014-02-031-1/+11
| | | | | | | | | the compiler. This will disable -ffunction-sections in older versions of Clang where it breaks build of sanitizer runtime library. llvm-svn: 200695
* [CMake] Untabify.NAKAMURA Takumi2014-02-022-20/+20
| | | | llvm-svn: 200644
* AddLLVM.cmake: Untabify.NAKAMURA Takumi2014-01-311-2/+2
| | | | llvm-svn: 200557
* HandleLLVMOptions.cmake: Typo, s/proerty/property/NAKAMURA Takumi2014-01-311-1/+2
| | | | llvm-svn: 200556
* [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
* HandleLLVMOptions.cmake: Typo in comment.NAKAMURA Takumi2014-01-301-1/+1
| | | | llvm-svn: 200498
* [CMake] llvm_update_compile_flags(name) doesn't require source files. TARGET ↵NAKAMURA Takumi2014-01-281-6/+6
| | | | | | PROPERTY SOURCES has them. llvm-svn: 200311
* [CMake] Prune CMAKE_CXX_FLAGS stuff in llvm_process_sources.NAKAMURA Takumi2014-01-281-18/+0
| | | | | | It is the final step to deprecate contextual CMAKE_CXX_FLAGS. llvm-svn: 200303
* [CMake] Enhance llvm_update_compile_flags(name sources) to handle ↵NAKAMURA Takumi2014-01-282-8/+43
| | | | | | | | | | | | | | | | 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
* [CMake] Apply -ffunction-data-sectinos not only to CMAKE_CXX_FLAGS, but also ↵NAKAMURA Takumi2014-01-281-1/+1
| | | | | | to CMAKE_C_FLAGS. llvm-svn: 200300
* [CMake] Move -ffunction-data-sections stuff to HandleLLVMOptions.NAKAMURA Takumi2014-01-282-10/+11
| | | | | | | | 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
* [CMake] Let llvm_process_sources check not only *.cpp but also *.c.NAKAMURA Takumi2014-01-281-2/+2
| | | | llvm-svn: 200298
* [CMake] Put *_exports into "Misc" folder.NAKAMURA Takumi2014-01-271-0/+1
| | | | llvm-svn: 200228
* [CMake] tablegen(): Use -I <dir> according to the list by include_directories().NAKAMURA Takumi2014-01-261-5/+17
| | | | | | For now, local_tds and global_tds are integrated to dependent_tds. llvm-svn: 200150
* [CMake] Functionalize tblgen().NAKAMURA Takumi2014-01-261-3/+3
| | | | llvm-svn: 200149
* [CMake] configure_lit_site_cfg: ${SHLIBDIR} should point the build tree.NAKAMURA Takumi2014-01-261-1/+5
| | | | llvm-svn: 200134
* Don't clobber CMAKE_REQUIRED_FLAGS, it ends up being used inChandler Carruth2014-01-211-0/+4
| | | | | | C compilations as well and these flags don't make any sense there. llvm-svn: 199756
* Fix VS2012 ID/version check.Amara Emerson2014-01-211-1/+1
| | | | llvm-svn: 199753
* Fix libstdc++4.7 test on Android.Evgeniy Stepanov2014-01-211-0/+3
| | | | llvm-svn: 199714
* [CMake] LLVMProcessSources.cmake: Add include(CMakeParseArguments).NAKAMURA Takumi2014-01-201-0/+1
| | | | | | I didn't realize that cmake_parse_arguments() would require explicit inclusion. llvm-svn: 199674
* [CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.NAKAMURA Takumi2014-01-201-2/+4
| | | | | | | | | | | | | | 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
* [CMake] Introduce new scheme of LLVM_TOOLS_BINARY_DIR and LLVM_LIBRARY_DIRNAKAMURA Takumi2014-01-191-3/+3
| | | | | | | | 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
* [CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.NAKAMURA Takumi2014-01-191-2/+0
| | | | llvm-svn: 199592
* Add the test for libstdc++ versions newer than 4.6 so we don'tChandler Carruth2014-01-171-0/+16
| | | | | | | | 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
* [cmake] Attempt to fix sanitizer buildbot.Quentin Colombet2014-01-161-2/+6
| | | | | | | | | 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
* Factor the option and checking of compiler version better. Put theChandler Carruth2014-01-131-0/+16
| | | | | | | | 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
* [CMake] Add a comment to tablegen's copy_if_different. Ninja reports every ↵NAKAMURA Takumi2014-01-121-1/+1
| | | | | | action by default. llvm-svn: 199058
* CMake: Provide LLVM_PLUGIN_EXT definitionAlp Toker2014-01-082-5/+8
| | | | | | | | | | | | | | | 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
* [CMake] Introduce llvm_update_compile_flags(target_name) to update compile ↵NAKAMURA Takumi2014-01-071-24/+36
| | | | | | | | flags in target properties. FIXME: Just add_unittest() is using it. FIXME: Cooperate with source properties. llvm-svn: 198683
* Introduce a cmake LLVM_ENABLE_LIBCXX build parameter to compile using libc++ ↵Jean-Daniel Dupas2014-01-061-0/+7
| | | | | | | | | | | | | | 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
* Add a FIXME.Nico Weber2014-01-051-0/+3
| | | | llvm-svn: 198528
* [CMake] Add missing set_output_directory after Takumi's change in r198205.Jordan Rose2014-01-021-1/+2
| | | | | | | | | 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
* CMake separate projects: use correct name for ↵Douglas Gregor2014-01-021-1/+1
| | | | | | LIBRARY_OUTPUT_DIRECTORY_${suffix}. llvm-svn: 198335
OpenPOWER on IntegriCloud