summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-06-27 09:01:24 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-06-27 09:01:24 +0000
commit984f6cf119e26ec25463d58235d613bfea114127 (patch)
treef045431572bd338ff5cb457918d0e69384d6bbaa /CMakeLists.txt
parentfc6c80e9402a8798e6426df7df3a867d541ca705 (diff)
downloadcompiler-rt-984f6cf119e26ec25463d58235d613bfea114127.tar.gz
compiler-rt-984f6cf119e26ec25463d58235d613bfea114127.tar.bz2
compiler-rt-984f6cf119e26ec25463d58235d613bfea114127.tar.xz
Add support for building the ASan instrumentation unit tests with the
just-built Clang binary, and linking them against the just-built ASan runtime. This is *very* brittle. I expect it will require tweaking, and I've pro-actively disabled it on non-Unix builds and on cross-builds. It is also currently missing dependency edges on GoogleTest header files and a few other corner cases, but those can be fixed. This is the major milestone of a mini-bootstrap-like build of the unittest. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e6a2acb..97835a1e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,16 @@ try_compile(CAN_TARGET_I386 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE32}
COMPILE_DEFINITIONS "${TARGET_I386_CFLAGS}"
CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_I386_CFLAGS}")
+# Because compiler-rt spends a lot of time setting up custom compile flags,
+# define a handy helper function for it. The compile flags setting in CMake
+# has serious issues that make its syntax challenging at best.
+function(set_target_compile_flags target)
+ foreach(arg ${ARGN})
+ set(argstring "${argstring} ${arg}")
+ endforeach()
+ set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}")
+endfunction()
+
add_subdirectory(lib)
if(LLVM_INCLUDE_TESTS)