[PATCH] D38853: [clang-format] Allow building fuzzer with OSS-Fuzz flags.
Matt Morehouse via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 12 10:38:01 PDT 2017
morehouse created this revision.
Herald added a subscriber: mgorny.
https://reviews.llvm.org/D38853
Files:
clang/tools/clang-format/CMakeLists.txt
clang/tools/clang-format/fuzzer/CMakeLists.txt
Index: clang/tools/clang-format/fuzzer/CMakeLists.txt
===================================================================
--- clang/tools/clang-format/fuzzer/CMakeLists.txt
+++ clang/tools/clang-format/fuzzer/CMakeLists.txt
@@ -1,11 +1,15 @@
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
ClangFormatFuzzer.cpp
)
target_link_libraries(clang-format-fuzzer
- ${CLANG_FORMAT_LIB_DEPS})
+ ${CLANG_FORMAT_LIB_DEPS}
+ ${LIB_FUZZING_ENGINE}
+ )
Index: clang/tools/clang-format/CMakeLists.txt
===================================================================
--- clang/tools/clang-format/CMakeLists.txt
+++ clang/tools/clang-format/CMakeLists.txt
@@ -15,7 +15,7 @@
${CLANG_FORMAT_LIB_DEPS}
)
-if( LLVM_USE_SANITIZE_COVERAGE )
+if( LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
add_subdirectory(fuzzer)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38853.118805.patch
Type: text/x-patch
Size: 1055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171012/26c3f82b/attachment.bin>
More information about the cfe-commits
mailing list