summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Add option LLVM_EXTERNALIZE_DEBUGINFOChris Bieneman2015-12-031-0/+27
| | | | | | | | | | | | Summary: This adds support for generating dSYM files and stripping debug info from executables and dylibs. It also supports passing -object_path_lto to the linker to generate dSYMs for LTO builds. Reviewers: bogner, friss Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15133 llvm-svn: 254627
* Fix non-PIC build after 253959Pavel Labath2015-11-241-1/+1
| | | | | | | | CMAKE_EXE_LINKER_FLAGS is a string. Appending a flag using list(APPEND) introduces an extra semicolon which breaks stuff. Change this to append the value in the same way that everyone else seems to be doing. llvm-svn: 253968
* [CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.Chris Bieneman2015-11-241-0/+4
| | | | | | Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources. llvm-svn: 253959
* [CMake] export_executable_symbols also needs to add -rdynamic to the linker ↵Chris Bieneman2015-11-241-0/+4
| | | | | | | | flags on Darwin Without -rdynamic LLVM built with LTO fails to pass "check" due to loadable modules failing. llvm-svn: 253944
* NFC. Fixing my consistently incorrect spelling.Chris Bieneman2015-11-231-4/+4
| | | | llvm-svn: 253936
* Unbreak build on OpenBSD by not adding -Wl,-z,defs to linker flags.Yaron Keren2015-11-211-1/+2
| | | | | | | | | | | | This is similar to the fix for FreeBSD in r226862. Without this patch, the build aborts when linkling libLTO.so, complaining about undefined references to assert2, cxa_atexit, etc. Patch by Stefan Kempf! http://reviews.llvm.org/D14236 llvm-svn: 253769
* [CMake] Fix handling of passing through semi-colon separated lists.Chris Bieneman2015-11-201-1/+2
| | | | | | When passing around CMake arguments as lists of arguments any arguments containing lists need to have their semi-colons escaped otherwise CMake will split the arguments in the middle. llvm-svn: 253719
* Don't search for third party libraries while using MSanReid Kleckner2015-11-191-0/+6
| | | | | | | | | | | | On the average user's system, those libraries will not be compiled with MSan. Prior to this change, the LLVM test suite was full of false positives from calls from third party libraries to MSan interceptors like strlen. We can remove this check if MSan ever grows a suppression mechanism similar to TSan's. llvm-svn: 253526
* [CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=OffChris Bieneman2015-11-181-7/+6
| | | | | | I'm unaware of any reasons why -fvisibility-inlines-hidden would depend on PIC, and since autoconf supports this flag without PIC, we should support it in CMake too. llvm-svn: 253517
* LLVM_ENABLE_MODULES: No need to set -fcxx-modules in trunk, just -fmodules.NAKAMURA Takumi2015-11-131-1/+1
| | | | llvm-svn: 252996
* [CMake] Fixing passthrough for variables starting with the sub-project nameChris Bieneman2015-11-111-1/+1
| | | | | | This allows TEST_SUITE variables to be passed from the top-level CMake into the external project. llvm-svn: 252810
* [CMake] Make llvm_install_library_symlink respect LLVM_LIBDIR_SUFFIX.Chris Bieneman2015-11-111-1/+1
| | | | | | This is required to support multilib install targets, and addresses a regression introduced in r252093. llvm-svn: 252749
* [CMake] Add support for building the llvm test-suite as part of an LLVM ↵Chris Bieneman2015-11-111-0/+194
| | | | | | | | | | | | | | | | | | | build using clang and lld Summary: This patch adds a new CMake module for working with ExternalProjects. This wrapper for ExternalProject supports using just-built tools and can hook up dependencies properly so that projects get cleared out. The example usage here is for the llvm test-suite. In this example, the test-suite is setup as dependent on clang and lld if they are in-tree. If the clang or lld binaries change the test-suite is re-configured, cleaned, and rebuilt. This cleanup and abstraction wrapping ExternalProject can be extended and applied to other runtime libraries like compiler-rt and libcxx. Reviewers: samsonov, jroelofs, rengolin, jmolloy Subscribers: jmolloy, llvm-commits Differential Revision: http://reviews.llvm.org/D14513 llvm-svn: 252747
* [cmake] move SONAME handling to llvm_add_libraryAndrew Wilkins2015-11-101-14/+19
| | | | | | | | | | | | | | | | | | | | Summary: Move handling of the SONAME option from add_llvm_library to llvm_add_library, so that it can be used in sub-projects. In particular, this makes it possible to have consistently named shared libraries for LLVM, Clang and LLDB. Also, base the SONAME and symlinks on the output name by extracting the OUTPUT_NAME property, rather than assuming it is the same as the target name. Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14539 llvm-svn: 252669
* AddLLVM: squelch CMP0007 by not adding empty elements to listRamkumar Ramachandra2015-11-101-3/+2
| | | | | | | | | | | | | When configuring various llvm projects that use AddLLVM.cmake, this warning is emitted many times, flooding the screen: Policy CMP0007 is not set: list command no longer ignores empty elements. The fix is removing an extra semicolon. Differential Revision: http://reviews.llvm.org/D14339 llvm-svn: 252628
* [CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not ↵Chris Bieneman2015-11-041-7/+52
| | | | | | | | | | | | | | | | | | | | | compatible with ldconfig Summary: This change makes the CMake build system generate libraries for Linux and Darwin matching the makefile build system. Linux libraries follow the pattern lib${name}.${MAJOR}.${MINOR}.so so that ldconfig won't pick it up incorrectly. Darwin libraries are not versioned. Note: On linux the non-versioned symlink is generated at install-time not build time. I plan to fix that eventually, but I expect that is good enough for the purposes of fixing this bug. Reviewers: loladiro, tstellarAMD Subscribers: axw, llvm-commits Differential Revision: http://reviews.llvm.org/D13841 llvm-svn: 252093
* llvm-config: Add --has-rtti optionTom Stellard2015-11-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This prints NO if LLVM was built with -fno-rtti or an equivalent flag and YES otherwise. The reasons to add -has-rtti rather than adding -fno-rtti to --cxxflags are: 1. Building LLVM with -fno-rtti does not always mean that client applications need this flag. 2. Some compilers have a different flag for disabling rtti, and the compiler being used to build LLVM may not be the compiler being used to build the application. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11849 llvm-svn: 252075
* Revert parts accidentally included in r251823David Blaikie2015-11-021-1/+1
| | | | llvm-svn: 251826
* StringRef-ify DiagnosticInfoSampleProfile::FilenameDavid Blaikie2015-11-021-1/+1
| | | | llvm-svn: 251823
* [CMake] Fixing dependency issue with parallel make when building with ↵Chris Bieneman2015-10-231-1/+8
| | | | | | | | LLVM_OPTIMIZED_TABLEGEN. Patch by Alex Wang llvm-svn: 251138
* Fix add_llvm_external_project.Manuel Klimek2015-10-221-1/+1
| | | | | | | | | | | | | r250835 unintentionally discarded the optional parameter to the add_llvm_external_project() macro that may point to a path when the said path is different from ${name}. This should fix it by passing ${ARGN} on to add_llvm_subdirectory(). The problem manifests itself with e.g. add_llvm_external_project(clang-tools-extra extra) from clang/tools/CMakeLists.txt Patch by Luchesar V. Iliev. llvm-svn: 251001
* [CMake] Refactor subdirectory inclusion code to take a project name.Chris Bieneman2015-10-201-23/+34
| | | | | | | | | | | | | | | Summary: This refactoring makes some of the code used to control including subdirectories parameterized so it can be re-used elsewhere. Specifically I want to re-use this code in clang to be able to turn off specific tool subdirectories. Reviewers: chapuni, filcab, bogner, Bigcheese Subscribers: emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D13783 llvm-svn: 250835
* [CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that ↵Chris Bieneman2015-10-162-11/+7
| | | | | | | | it can be used for libraries too. In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable. llvm-svn: 250573
* Split -pedantic and -Wno-long-long into two separate flags so libc++ can ↵Eric Fiselier2015-10-131-1/+2
| | | | | | remove -pedantic llvm-svn: 250255
* cmake: Avoid leading space in LLVM_DEFINITIONS.Pawel Bylica2015-10-121-1/+5
| | | | | | | | | | Summary: Unnecessary space at the beginning of LLVM_DEFINITIONS in cmake shared files can break projects that use the variable. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13432 llvm-svn: 250025
* [CMake] Parallel make breaks on native tablegenChris Bieneman2015-10-091-1/+10
| | | | | | | | Patch by Alex Wang This patch resolves a parallelization issue that occurs when native tablegen targets are built at the same time. They both try to build libSupport and clobber each other causing the builds to fail. llvm-svn: 249911
* Enable gtest SEH when building with clang-clReid Kleckner2015-10-081-4/+0
| | | | | | | Clang supports SEH well enough that this should work out of the box. If it doesn't, we'll hear about it. llvm-svn: 249766
* Revert "Enable -Wdeprecated in the cmake build now that LLVM (& Clang, ↵David Blaikie2015-10-011-1/+1
| | | | | | | | | | | Polly, and LLD) are -Wdeprecated clean" This reverts commit r248963. Seems there's some standard libraries (and libcxxabi implementations) that aren't -Wdeprecated clean... hrm. llvm-svn: 248972
* Enable -Wdeprecated in the cmake build now that LLVM (& Clang, Polly, and ↵David Blaikie2015-09-301-1/+1
| | | | | | | | | | | | | | | | | | | LLD) are -Wdeprecated clean This particularly helps enforce the C++ Rule of 5 (for new move ops this is already an error, but for a type only using C++98 features (copy ctor/assign, dtor) it is only deprecated, not invalid) Applying the flag for any GCC compatible compiler - GCC doesn't warn on the Rule of 5 cases that C++11 deprecates, but it doesn't have other false positives so far as I could see (compiling with GCC 4.8 didn't produce any -Wdeprecated warnings I could spot). Reviewers: aaron.ballman Differential Revision: http://reviews.llvm.org/D13314 llvm-svn: 248963
* [CMake] Make the bindir and libdir arguments to set_output_directory optionalJohn Brawn2015-09-301-20/+29
| | | | | | | | | | | | When building a plugin against an installed LLVM toolchain using add_llvm_loadable_module (in the documented manner) doesn't work as nothing sets the *_OUTPUT_INTDIR variables causing an error when set_output_directory is called. Making those arguments optional (causing the default output directory to be used) fixes this. Differential Revision: http://reviews.llvm.org/D13215 llvm-svn: 248911
* [CMake] Adjust the variables set by LLVMConfig.cmakeJohn Brawn2015-09-301-1/+4
| | | | | | | | | | | When using LLVMConfig.cmake from an installed toolchain in order to build a loadable pass using add_llvm_loadable_module LLVM_ENABLE_PLUGINS and LLVM_PLUGIN_EXT must be set. Also make LLVM_DEFINITIONS be set to what it actually is. Differential Revision: http://reviews.llvm.org/D13214 llvm-svn: 248884
* [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate fileJohn Brawn2015-09-293-8/+14
| | | | | | | | | | | | Currently LLVM_COMPILER_IS_GCC_COMPATIBLE is set as a side-effect of determining the stdlib to use in HandleLLVMStdlib, which causes problems when attempting to use AddLLVM from an installed LLVM toolchain, as HandleLLVMStdlib is not used. Move the setting of this variable into DetermineGCCCompatible and include that from both AddLLVM and HandleLLVMStdlib. Differential Revision: http://reviews.llvm.org/D13216 llvm-svn: 248798
* [CMake] Adding ALWAYS_GENERATE option to symlink utility functions.Chris Bieneman2015-09-181-20/+33
| | | | | | This implements the behavior required for clang symlinks which should be always generated. llvm-svn: 248039
* [CMake] More cleanup of installing symlinks.Chris Bieneman2015-09-182-1/+7
| | | | | | | | In order to support building clang out-of-tree the install_symlink script needs to be installed, and it needs to be found by searching the CMAKE_MODULE_PATH. This change renames install_symlink -> LLVMInstallSymlink so it doesn't conflict with naming from other projects, and adds searching behavior in AddLLVM.cmake llvm-svn: 248009
* [CMake] More refactoring of symlink creation.Chris Bieneman2015-09-161-11/+17
| | | | | | This refactoring is to enable clang to re-use this code. llvm-svn: 247850
* [CMake] Rename target->dest as per feedback from Chapuni on ↵Chris Bieneman2015-09-151-10/+10
| | | | | | http://reviews.llvm.org/D12864 llvm-svn: 247658
* [CMake] Refactor and cleanup generating and installing symlinks to tools.Chris Bieneman2015-09-142-0/+76
| | | | | | | | | | | | Summary: This change generalizes symlink generation and makes symlinks to tools obey LLVM_TOOLCHAIN_TOOLS. It makes it so that if you exclude llvm-ar from LLVM_TOOLCHAIN_TOOLS you don't end up with broken symlinks to llvm-lib and llvm-ranlib in your install. Reviewers: bogner, chapuni, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12864 llvm-svn: 247632
* [CMake] s/LLVM_SOURCE_DIR/LLVM_MAIN_SRC_DIR/Jordan Rose2015-09-101-1/+1
| | | | | | | | Fix-up for r247305 to use the right variable. There's another use of LLVM_SOURCE_DIR in this file that is probably also questionable, but it's for Windows so I'm going to leave it alone. llvm-svn: 247311
* [CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overriddenChris Bieneman2015-09-101-5/+6
| | | | llvm-svn: 247306
* [CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.Jordan Rose2015-09-102-0/+7
| | | | | | | | | | | | | This amends chapuni's r246156 to handle an Xcode quirk, one even called out in the CMake documentation: Some native build systems may not like targets that have only object files, so consider adding at least one real source file to any target that references $<TARGET_OBJECTS:objlib>. I've limited the scope of this hack to Xcode for now. llvm-svn: 247305
* Silencing C4141 warnings that were introduced en masse because __forceinline ↵Aaron Ballman2015-09-101-0/+1
| | | | | | cannot be combined with inline in MSVC without triggering this diagnostic. This is safe to disable because clang will catch instances of the issue with -Wduplicate-decl-specifier, so we are not losing diagnostic coverage. llvm-svn: 247275
* [CMake] Flag recursive cmake invocations for cross-compileJoseph Tremoulet2015-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Cross-compilation uses recursive cmake invocations to build native host tools. These recursive invocations only forward a fixed set of variables/options, since the native environment is generally the default. This change adds -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE to the recursive cmake invocations, so that cmake files can distinguish these recursive invocations from top-level ones, which can explain why expected options are unset. LLILC will use this to avoid trying to generate its build rules in the crosscompile native host target (where it is not needed), which would fail if attempted because LLILC requires a cmake variable passed on the command line, which is not forwarded in the recursive invocation. Reviewers: rnk, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12679 llvm-svn: 247151
* [CMake][CMP0051] Avoid for user of objlib to use llvm_update_compile_flags().NAKAMURA Takumi2015-09-081-2/+8
| | | | | | $<TARGET_OBJECTS> shouldn't require compile flags. Flags are set in obj.${name}. llvm-svn: 246984
* [cmake] rework LLVM_LINK_LLVM_DYLIB option handlingAndrew Wilkins2015-09-053-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This diff attempts to address the concerns raised in http://reviews.llvm.org/D12488. We introduce a new USE_SHARED option to llvm_config, which, if set, causes the target to be linked against libLLVM. add_llvm_utility now uniformly disables linking against libLLVM. These utilities are not intended for distribution, and this keeps the option handling more centralised. llvm-shlib is now processes before any other "tools" subdirectories, ensuring the libLLVM target is defined before its dependents. One main difference from what was requested: llvm_config does not prune LLVM_DYLIB_COMPONENTS from the components passed into explicit_llvm_config. This is because the "all" component does something special, adding additional libraries (namely libLTO). Adding the component libraries after libLLVM should not be a problem, as symbols will be resolved in libLLVM first. Finally, I'm not really happy with the DISABLE_LLVM_LINK_LLVM option, but I'm not sure of a better way to get the following: - link all tools and shared libraries to libLLVM if LLVM_LINK_LLVM_DYLIB is set - some way of explicitly *not* doing so for utilities and libLLVM itself Suggestions for improvement here are particularly welcome. Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12590 llvm-svn: 246918
* [CMake] Don't use OBJLIB on Xcode.NAKAMURA Takumi2015-09-021-2/+4
| | | | | | I got a few reports it didn't work. llvm-svn: 246629
* cmake: Error instead of warning and dropping invalid LLVM_USE_SANITIZERJustin Bogner2015-09-011-3/+3
| | | | | | | | | | | | | Currently, if you call cmake with a typo in an LLVM_USE_SANITIZER value, there's a cmake warning and the build goes on with no sanitizers at all. This isn't a good behaviour, since cmake warnings are fairly easy to miss and the resulting behaviour is that it looks like the build is sanitizer clean. Upgrade these warnings to errors so misconfigurations are more obvious. llvm-svn: 246531
* Enable linking tools, shared libraries against libLLVMAndrew Wilkins2015-09-012-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Three closely related changes, to have a mode in which we link all executables and shared libraries against libLLVM. 1. Add a new LLVM_LINK_LLVM_DYLIB cmake option, which, when ON, will link executables and shared libraries against libLLVM. For this to work, it is necessary to also set LLVM_BUILD_LLVM_DYLIB and LLVM_DYLIB_EXPORT_ALL. It is not strictly necessary to set LLVM_DISABLE_LLVM_DYLIB_ATEXIT, but we also default to OFF in this mode, or tools tend to misbehave (e.g. stdout may not flush on exit when output is buffered.) llvm-config and Tablegen do not use libLLVM, as they are dependencies of libLLVM. 2. Modify llvm-go to take a new flag, "linkmode=component-libs|dylib". Depending on which one is passed (default is component-libs), we link with the individual libraries or libLLVM respectively. We pass in dylib when LLVM_LINK_LLVM_DYLIB is ON. 3. Fix LLVM_DYLIB_EXPORT_ALL on Linux, and expand the symbols exported to actually export all. Don't strip leading underscore from symbols on Linux, and make sure we get all exported symbols and weak-with-default symbols ("W" in nm output). Without these changes, passes won't load because the "Annotate..." symbols defined in lib/Support/Valigrind.cpp are not found. Testing: - Ran default build ("ninja") with LLVM, clang, compiler-rt, llgo, lldb. - Ran "check", "check-clang", "check-tsan", "check-libgo" targets. I've never had much success with LLDB tests, and llgoi is currently broken so check-llgo fails for an unrelated reason. - Ran "lldb" to ensure it loads. Reviewers: chandlerc, beanz, pcc, rnk Subscribers: rnk, chapuni, sylvestre.ledru, llvm-commits Differential Revision: http://reviews.llvm.org/D12488 llvm-svn: 246527
* [CMake] Fix build on MSVC in r246156.NAKAMURA Takumi2015-08-281-1/+2
| | | | | | add_windows_version_resource_file() affects ALL_FILES. OBJLIB shouldn't have *.obj as SOURCES. llvm-svn: 246241
* [CMake] OBJLIB-ize *-tblgen.NAKAMURA Takumi2015-08-272-0/+17
| | | | | | | | | | | | This improves dependency chain of; (LLVMSupport && LLVMTableGen) && (*.cpp in *-tblgen) && (linking *-tblgen) with; (LLVMSupport && LLVMTableGen && *.cpp) && (linking *-tblgen) llvm-svn: 246156
* [cmake] Pass /manifest:no to the linker when asan is enabledReid Kleckner2015-08-251-1/+5
| | | | | | This is a workaround for PR24476. llvm-svn: 245945
OpenPOWER on IntegriCloud