summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2017-08-31 00:36:33 +0000
committerJustin Bogner <mail@justinbogner.com>2017-08-31 00:36:33 +0000
commit5204717208fd86e3e0414849c5a9813736cceb53 (patch)
tree76be1d882edf49471dd531f7dc6b169b2d717e08 /llvm/cmake/modules/AddLLVM.cmake
parent28454efc677b718be3b000aaeabafc1788bb3258 (diff)
downloadbcm5719-llvm-5204717208fd86e3e0414849c5a9813736cceb53.tar.gz
bcm5719-llvm-5204717208fd86e3e0414849c5a9813736cceb53.zip
cmake: Invent add_llvm_fuzzer to set up fuzzer targets
This moves the cmake configuration for fuzzers in LLVM to a new macro, add_llvm_fuzzer. This will make it easier to keep things consistent while implementing llvm.org/pr34314. I've also made a couple of minor functional changes here: - the fuzzers now use add_llvm_executable rather than add_llvm_tool. This means they won't create install targets and stuff like that, because those made little sense for these fuzzers. - I've grouped these under "Fuzzers" rather than in with "Tools" for people who build with IDEs. llvm-svn: 312200
Diffstat (limited to 'llvm/cmake/modules/AddLLVM.cmake')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 1c922651b13..8c884db4706 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -892,6 +892,13 @@ macro(add_llvm_utility name)
endif()
endmacro(add_llvm_utility name)
+macro(add_llvm_fuzzer name)
+ if( LLVM_USE_SANITIZE_COVERAGE )
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
+ add_llvm_executable(${name} ${ARGN})
+ set_target_properties(${name} PROPERTIES FOLDER "Fuzzers")
+ endif()
+endmacro()
macro(add_llvm_target target_name)
include_directories(BEFORE
OpenPOWER on IntegriCloud