summaryrefslogtreecommitdiff
path: root/cmake/Modules
AgeCommit message (Collapse)Author
2014-12-04CMake: build DLLs in the right directory and include them in the 'install' ↵Hans Wennborg
target (PR21719) When CMake builds a dynamic library on Windows, the .dll file's location is determined by the RUNTIME_OUTPUT_DIRECTORY, which we were previously not setting. This means for example that clang_rt.asan_dynamic-i386.dll will get built and installed in the same directory as the corresponding .lib file, instead of being built in the bin/ directory and not installed at all. Differential Revision: http://reviews.llvm.org/D6508 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223387 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-29Reverting r220517; it seems this broke check-asan.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220869 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23Cmake variables are global, which is why we would get crud like /machine:X86 ↵Aaron Ballman
in the list of compiler options for MSVC. Clear out the variable before attempting to enumerate arguments and set them. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220522 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23Do not set linker flags for MSVC; they are not the same thing as compiler ↵Aaron Ballman
flags. Note, this is already done in the add_compiler_rt_test test_suite function. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220517 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka
let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219860 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[CMake] Cleanup CMake rules after r219302. NFC.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219825 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-29[sanitizer] Android build cleanup.Evgeniy Stepanov
* Detect Android toolchain target arch and set correct runtime library name. * Merged a lot of Android and non-Android code paths. * Android is only supported in standalone build of compiler-rt now. * Linking lsan-common in ASan-Android (makes lsan annotations work). * Relying on -fsanitize=address linker flag when building tests (again, unification with non-Android path). * Runtime library moved from lib/asan to lib/linux. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25Fix a mistake in r217762Ehsan Akhgari
Summary: The extra macro definition needs to go into COMPILER_RT_GTEST_CFLAGS in order to be used for gtests on MSVC2012. Test Plan: This is part of the fixes necessary for the ASAN tests to pass with MSVC2012. Reviewers: timurrrr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5493 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218464 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25Follow-up for r217523: fix the dependencies for standalone compiler-rt build.Alexander Potapenko
Patch by Kuba Brecka (kuba.brecka@gmail.com) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218444 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-15Port the variadic std::tr1::tuple hack for building gtest for MSVC2012 to ↵Ehsan Akhgari
ASAN tests. Summary: This is copied from llvm/utils/unittest/CMakeLists.txt. Test Plan: This partly enables building ASAN tests with MSVC2012. Reviewers: timurrrr Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5342 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217762 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10Make compiler-rt tests work with relocatable SDKs on OS XKuba Brecka
Reviewed at http://reviews.llvm.org/D4047 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217523 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-30[Sanitizers Win] Move duplicate Windows-specific compiler flags to a common ↵Timur Iskhodzhanov
CMake variable Reviewed at http://reviews.llvm.org/D3952 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209889 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-28[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make ↵Timur Iskhodzhanov
Windows-only tests explicitly use clang-cl. Reviewed at http://reviews.llvm.org/D3893 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209719 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15Exclude MSVC to try to unbreak their builds. We have a bad skew betweenChandler Carruth
how CMake drives a windows link and how our custom command does. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208903 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15Teach the compiler-rt custom compilation and linking CMake rules usedChandler Carruth
for sanitizers to pass the C++ compilation and exe linking flags through from the host CMake configuration. We pass the target flags afterward, allowing them to trump flags as needed. This is particularly important when the flags direct Clang, even the just-built-Clang, toward the standard library, linker, and other tools to use. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208896 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12[CMake] Log output of configure/build/install steps for instrumented libcxx ↵Alexey Samsonov
to reduce noise git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208632 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-12[ASan tests] Use clang-cl to build tests on WindowsTimur Iskhodzhanov
Reviewed at http://reviews.llvm.org/D3680 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-09[CMake] Use ExternalProject to build MSan-ified version of libcxx for unit ↵Alexey Samsonov
tests. This change lets MSan rely on libcxx's own build system instead of manually compiling its sources and setting up all the necessary compile flags. It would also simplify compiling libcxx with another sanitizers (in particular, TSan). The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or MSan runtime library is changed. "clobber" step used in this patch works well for me, but it's possible it would break for other configurations - will watch the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208451 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01[ASan] Optional support for dynamic ASan runtime on Linux.Alexey Samsonov
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205308 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov
Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24[CMake] Rename the variableAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204602 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commandsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21fixed check_lint.sh in standalone buildGreg Fitzgerald
Change-Id: I30d340bbe6b2028cc0f831399b62521912dcac60 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13[CMake] Use /W3 instead of -Wall on Windows. Remove add_definitions abuse.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203786 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13[CMake] Make append_if semantics similar to those used in LLVMAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203773 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[CMake] Port add_sanitizer_rt_symbols to CMake 3.0Alexey Samsonov
Patch by Brad King. Our add_sanitizer_rt_symbols macro reads the LOCATION property of a library to compute the location of the "lib<name>.a.syms" file to generate next to the corresponding "lib<name>.a" library file. CMake 3.0 introduces policy CMP0026 to disallow reading of the LOCATION target property from non-imported targets in favor of the more powerful $<TARGET_FILE> generator expression. Teach add_sanitizer_rt_symbols to use the $<TARGET_FILE> generator expression to compute the location of the symbols file to generate with a custom command. CMake 3.0 also adds support for generator expressions to install(FILES) so use it when available to simplify installation of the symbols file of the proper configuration. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202797 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04[CMake] Fix add_sanitizer_rt_symbols on multi-config CMake generators.Alexey Samsonov
Patch by Brad King. When using a multi-config generator with CMake, such as for VS or Xcode, the LOCATION target property value contains a placeholder such as "$(Configuration)" that is meant for substitution by the native build tool. The install(FILES) command does not understand this name and will not install the symbols file correctly when using these generators. Teach add_sanitizer_rt_symbols to read the more-specific target property LOCATION_<CONFIG> that has a per-configuration value and no placeholder. On single-configuration generators (Makefile, Ninja), CMAKE_BUILD_TYPE contains the name of the one configuration to be built. On multi-config generators (VS, Xcode), CMAKE_CONFIGURATION_TYPES contains the list of possible configurations. In the latter case, loop over the configs and add a configuration-specific install(FILES) rule for each one. Place the code block inside an if(TRUE) block so it can be made conditional in a following change without updating indentation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202796 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[asan] Install asan_device_setup to bin/ when targetting Android.Evgeniy Stepanov
asan_device_setup is a utility that prepares a device to run code built with ASan. Essentially, it installs ASan runtime library into the system. For this reason, it has to be at a predictable relative path from the runtime library itself. We also plan to distribute this utility, packaged with runtime library and maybe llvm-symbolizer, to the users. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202362 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27[CMake] Make sure add_compiler_rt_resource_file doesn't do unnecessary workAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202356 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26Append -D__func__=__FUNCTION__ to SANITIZER_COMMON_CFLAGSReid Kleckner
This way it gets picked up for all sanitizer libs, both sanitizer_common and asan. I believe those are the only libs that build with asan. There should be no need to set the __func__ definition inside clang_compile. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202303 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26Emulate C99/C++11 __func__ for Visual C++.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202296 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24[CMake] Better support for COMPILER_RT_ENABLE_WERROR. Make sure compiler-rt ↵Alexey Samsonov
libraries are build by 'make all' command git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[CMake] Use host compiler to build unittests in standalone modeAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201672 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19[CMake] Rudimentary support for standalone CompilerRT build system.Alexey Samsonov
This change allows to build compiler-rt libraries separately from LLVM/Clang (path to LLVM build directory should be specified at configure time). Running tests is not yet supported. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201647 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Rename several variablesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov
'compiler-rt' target encompassing them all. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Simplify setting compile flag disabling RTTIAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201547 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15LLVM's GoogleTest copy has moved its source code back to the defaultChandler Carruth
location, update this reference to reflect that. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194802 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-07[ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib Alexander Potapenko
CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code. The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194199 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25Add a CMake option COMPILER_RT_DEBUG for building runtimes with full debug info.Peter Collingbourne
Differential Revision: http://llvm-reviews.chandlerc.com/D1984 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01Add top-level CMake 'compiler-rt' target to build all compiler-rt librariesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191747 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16[ASan] Split ASan unit tests into two different binaries:Alexey Samsonov
(1) instrumented, i.e. compiled and linked with -fsanitize=address (2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29[sanitizer] Refine CMake rules for generating exported symbols and lint checkingAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28sanitizer_common: Use PYTHON_EXECUTABLE to choose appropriate python.Will Dietz
Fixes build on systems where 'python' is not python2. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27Properly generate lists of exported symbols for sanitizer runtimesAlexey Samsonov
This change adds a Python script that is invoked for the just-built sanitizer runtime to generate the list of exported symbols passed to the linker. By default, it contains interceptors and sanitizer interface functions, but can be extended with tool-specific lists. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21[ASan] create default (empty) ASan blacklist file in resource directoryAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182380 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Build and install .syms files alongside sanitizer runtimes. These are used toRichard Smith
specify which symbols are exported to DSOs when the sanitizer is statically linked into a binary. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177784 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-08[CMake] set -mmacosx-version-min to 10.7 if compiler-rt is built with ↵Alexey Samsonov
-stdlib=libc++ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28CMake: simplify build rules for compiler-rt unit tests. This fixes warnings ↵Alexey Samsonov
in Ninja build tree. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28[CMake] Fix compiler-rt tests after r173617Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173668 91177308-0d34-0410-b5e6-96231b3b80d8