summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-fuzzer/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/clang-fuzzer/CMakeLists.txt')
-rw-r--r--clang/tools/clang-fuzzer/CMakeLists.txt34
1 files changed, 30 insertions, 4 deletions
diff --git a/clang/tools/clang-fuzzer/CMakeLists.txt b/clang/tools/clang-fuzzer/CMakeLists.txt
index cc9266c4db6..039449aca6f 100644
--- a/clang/tools/clang-fuzzer/CMakeLists.txt
+++ b/clang/tools/clang-fuzzer/CMakeLists.txt
@@ -14,6 +14,7 @@ set(LLVM_OPTIONAL_SOURCES
ClangFuzzer.cpp
DummyClangFuzzer.cpp
ExampleClangProtoFuzzer.cpp
+ ExampleClangLoopProtoFuzzer.cpp
)
if(CLANG_ENABLE_PROTO_FUZZER)
@@ -24,6 +25,7 @@ if(CLANG_ENABLE_PROTO_FUZZER)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS cxx_proto.proto)
+ protobuf_generate_cpp(LOOP_PROTO_SRCS LOOP_PROTO_HDRS cxx_loop_proto.proto)
set(LLVM_OPTIONAL_SOURCES ${LLVM_OPTIONAL_SOURCES} ${PROTO_SRCS})
add_clang_library(clangCXXProto
${PROTO_SRCS}
@@ -33,13 +35,21 @@ if(CLANG_ENABLE_PROTO_FUZZER)
${PROTOBUF_LIBRARIES}
)
+ add_clang_library(clangCXXLoopProto
+ ${LOOP_PROTO_SRCS}
+ ${LOOP_PROTO_HDRS}
+
+ LINK_LIBS
+ ${PROTOBUF_LIBRARIES}
+ )
+
# Build and include libprotobuf-mutator
include(ProtobufMutator)
include_directories(${ProtobufMutator_INCLUDE_DIRS})
# Build the protobuf->C++ translation library and driver.
add_clang_subdirectory(proto-to-cxx)
-
+
# Build the fuzzer initialization library.
add_clang_subdirectory(fuzzer-initialize)
@@ -49,16 +59,32 @@ if(CLANG_ENABLE_PROTO_FUZZER)
ExampleClangProtoFuzzer.cpp
)
- target_link_libraries(clang-proto-fuzzer
- PRIVATE
+ # Build the loop protobuf fuzzer
+ add_clang_executable(clang-loop-proto-fuzzer
+ ${DUMMY_MAIN}
+ ExampleClangLoopProtoFuzzer.cpp
+ )
+
+ set(COMMON_PROTO_FUZZ_LIBRARIES
${ProtobufMutator_LIBRARIES}
${PROTOBUF_LIBRARIES}
${LLVM_LIB_FUZZING_ENGINE}
- clangCXXProto
clangFuzzerInitialize
clangHandleCXX
+ )
+
+ target_link_libraries(clang-proto-fuzzer
+ PRIVATE
+ ${COMMON_PROTO_FUZZ_LIBRARIES}
+ clangCXXProto
clangProtoToCXX
)
+ target_link_libraries(clang-loop-proto-fuzzer
+ PRIVATE
+ ${COMMON_PROTO_FUZZ_LIBRARIES}
+ clangCXXLoopProto
+ clangLoopProtoToCXX
+ )
endif()
add_clang_subdirectory(handle-cxx)
OpenPOWER on IntegriCloud