summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTCompile.cmake
AgeCommit message (Collapse)Author
2017-10-12[cmake] Fix skipping DEPS (typo) in sanitizer_test_compile()Michal Gorny
Fix typo in variable assignment inside sanitizer_test_compile() that resulted in TEST_DEPS parameter not being included in the clang_compile() call. Spotted by George Karpenkov in D38444. Differential Revision: https://reviews.llvm.org/D38838 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-28Proper dependency check for clang in compiler_rt.George Karpenkov
- Not having a dependency does not work in standalone build, as Clang does not exist. - if (TARGET clang) check is useless, as it is order-dependent, and Clang may not be registered yet. Differential Revision: https://reviews.llvm.org/D37228 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-25Revert "Add Clang dependency to the check for Clang C++ headers."Adrian Prantl
This temporarily reverts commit r311733, because of bot breakage. http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/38139/consoleFull#-256426522e9a0fee5-ebcc-4238-a641-c5aa112c323e git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24Add Clang dependency to the check for Clang C++ headers.George Karpenkov
The problem is that CMake is mostly imperative and the result of processing "if (TARGET blah)" checks depends on the order of import of CMake files. In this case, "projects" folder is registered before "tools", and calling "CheckClangHeaders" [renamed to have a better name] errors out without even giving Clang a chance to be built. This, in turn, leads to libFuzzer bot failures in some circumstances on some machines (depends on whether LIT or UNIT tests are scheduled first). Differential Revision: https://reviews.llvm.org/D37126 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15[CMake compiler-rt] NFC: Minor CMake refactoring.George Karpenkov
Detect ObjC files in `clang_compile` and pass an appropriate flag to a compiler, also change `clang_compile` to a function. Differential Revision: https://reviews.llvm.org/D36727 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15[compiler-rt CMake] NFC: Minor CMake refactoring.George Karpenkov
Change macro to a function, and use a generic variable instead of branching for handling multi-output build with CMAKE_CONFIGURATION_TYPES. Differential Revision: https://reviews.llvm.org/D36725 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28[sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov
Currently there's a large amount of CMake logic duplication for compiling sanitizer tests. If we add more sanitizers, the duplication will get even worse. This change factors out common compilation commands into a macro available to all sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01[CMake] Use LLVM_MAIN_SRC_DIR instead of LLVM_SOURCE_DIR.Alexey Samsonov
The former will be properly initialized in standalone CMake build of compiler-rt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259407 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11[tsan] Add TSan unit test support for OS XKuba Brecka
This patch enables building and running TSan unit tests on OS X. Differential Revision: http://reviews.llvm.org/D14546 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20[CMake] Turns out CMake was passing the space as part of the argument ↵Chris Bieneman
instead of separating two arguments. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20[CMake] [OS X] Don't require command line tools installations for running ↵Chris Bieneman
compiler-rt tests. If you're on an Apple platform and /usr/include doesn't exist, we should set a sysroot flag when calling clang. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas
Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240120 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13Translate some MSVC CMAKE_*_FLAGS to clang flags in clang_compileReid Kleckner
Passing MSVC-style cflags to the gcc-style clang driver will almost always end badly. Just translate a couple of simple flags used by the base CMake cflags like /D, /U, and /O. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@232219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-06[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.Alexey Samsonov
Propagate -DSANITIZER_DEBUG definition to unit tests. Make sure unit tests depend on compiler-rt headers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225298 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-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-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-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-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-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-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
2012-12-19Significantly change the way we build ASan unittests in CMakeAlexey Samsonov
build tree. Now just-built Clang is used to: 1) compile instrumented sources (as before); 2) compile non-instrumented sources; 3) compile our own instrumented version of googletest; 4) link it all together using -fsanitize=address flag (instead of trying to copy linker behavior in CMake build rules). This makes ASan unittests pretty much self-consistent and independent of other LLVM libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170541 91177308-0d34-0410-b5e6-96231b3b80d8