summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2017-10-12 18:39:10 +0000
committerMatt Morehouse <mascasa@google.com>2017-10-12 18:39:10 +0000
commitd9cc80975edfe9d9d51cb8229cf20f7027ce1b08 (patch)
tree15413c14159183162c036ff97b616846616d1b81
parentfe35898b424244c4ba6e8e98863b1283eecbac80 (diff)
downloadbcm5719-llvm-d9cc80975edfe9d9d51cb8229cf20f7027ce1b08.tar.gz
bcm5719-llvm-d9cc80975edfe9d9d51cb8229cf20f7027ce1b08.zip
[clang-format] Allow building fuzzer with OSS-Fuzz flags.
Reviewers: kcc, bogner Reviewed By: kcc Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D38853 llvm-svn: 315603
-rw-r--r--clang/tools/clang-format/CMakeLists.txt2
-rw-r--r--clang/tools/clang-format/fuzzer/CMakeLists.txt8
2 files changed, 7 insertions, 3 deletions
diff --git a/clang/tools/clang-format/CMakeLists.txt b/clang/tools/clang-format/CMakeLists.txt
index a13633eaefc..466cc009b4f 100644
--- a/clang/tools/clang-format/CMakeLists.txt
+++ b/clang/tools/clang-format/CMakeLists.txt
@@ -15,7 +15,7 @@ target_link_libraries(clang-format
${CLANG_FORMAT_LIB_DEPS}
)
-if( LLVM_USE_SANITIZE_COVERAGE )
+if( LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
add_subdirectory(fuzzer)
endif()
diff --git a/clang/tools/clang-format/fuzzer/CMakeLists.txt b/clang/tools/clang-format/fuzzer/CMakeLists.txt
index 9dc4f2a6e8b..245186eea1f 100644
--- a/clang/tools/clang-format/fuzzer/CMakeLists.txt
+++ b/clang/tools/clang-format/fuzzer/CMakeLists.txt
@@ -1,6 +1,8 @@
set(LLVM_LINK_COMPONENTS support)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
+if(LLVM_USE_SANITIZE_COVERAGE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
+endif()
add_clang_executable(clang-format-fuzzer
EXCLUDE_FROM_ALL
@@ -8,4 +10,6 @@ add_clang_executable(clang-format-fuzzer
)
target_link_libraries(clang-format-fuzzer
- ${CLANG_FORMAT_LIB_DEPS})
+ ${CLANG_FORMAT_LIB_DEPS}
+ ${LIB_FUZZING_ENGINE}
+ )
OpenPOWER on IntegriCloud