head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.12
	netbsd-11-base:1.1.1.1
	netbsd-10-1-RELEASE:1.1.1.1
	perseant-exfatfs-base-20240630:1.1.1.1
	perseant-exfatfs:1.1.1.1.0.10
	perseant-exfatfs-base:1.1.1.1
	netbsd-10-0-RELEASE:1.1.1.1
	netbsd-10-0-RC6:1.1.1.1
	netbsd-10-0-RC5:1.1.1.1
	netbsd-10-0-RC4:1.1.1.1
	netbsd-10-0-RC3:1.1.1.1
	netbsd-10-0-RC2:1.1.1.1
	netbsd-10-0-RC1:1.1.1.1
	netbsd-10:1.1.1.1.0.8
	netbsd-10-base:1.1.1.1
	cjep_sun2x-base1:1.1.1.1
	cjep_sun2x:1.1.1.1.0.6
	cjep_sun2x-base:1.1.1.1
	cjep_staticlib_x-base1:1.1.1.1
	LLVM-249b40b558955afe5ac2b549edcf2d7f859c8cc9:1.1.1.1
	cjep_staticlib_x:1.1.1.1.0.4
	cjep_staticlib_x-base:1.1.1.1
	phil-wifi-20200421:1.1.1.1
	phil-wifi-20200411:1.1.1.1
	is-mlppp:1.1.1.1.0.2
	is-mlppp-base:1.1.1.1
	phil-wifi-20200406:1.1.1.1
	phil-wifi-20191119:1.1.1.1
	LLVM-01f3a59fb3e2542fce74c768718f594d0debd0da:1.1.1.1
	LLVM:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2019.11.08.14.29.40;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	lIv69tfiG0KHw3KB;

1.1.1.1
date	2019.11.08.14.29.40;	author joerg;	state Exp;
branches;
next	;
commitid	lIv69tfiG0KHw3KB;


desc
@@


1.1
log
@Initial revision
@
text
@set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} FuzzMutate)
set(CXX_FLAGS_NOFUZZ ${CMAKE_CXX_FLAGS})
set(DUMMY_MAIN DummyClangFuzzer.cpp)
if(LLVM_LIB_FUZZING_ENGINE)
  unset(DUMMY_MAIN)
elseif(LLVM_USE_SANITIZE_COVERAGE)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
  set(CXX_FLAGS_NOFUZZ "${CXX_FLAGS_NOFUZZ} -fsanitize=fuzzer-no-link")
  unset(DUMMY_MAIN)
endif()

# Needed by LLVM's CMake checks because this file defines multiple targets.
set(LLVM_OPTIONAL_SOURCES
  ClangFuzzer.cpp
  ClangObjectiveCFuzzer.cpp
  DummyClangFuzzer.cpp
  ExampleClangProtoFuzzer.cpp
  ExampleClangLoopProtoFuzzer.cpp
  ExampleClangLLVMProtoFuzzer.cpp
  )

if(CLANG_ENABLE_PROTO_FUZZER)
  # Create protobuf .h and .cc files, and put them in a library for use by
  # clang-proto-fuzzer components.
  find_package(Protobuf REQUIRED)
  add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI)
  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}
    ${PROTO_HDRS}

    LINK_LIBS
    ${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 protobuf->LLVM IR translation library and driver.
  add_clang_subdirectory(proto-to-llvm)
  
  # Build the fuzzer initialization library.
  add_clang_subdirectory(fuzzer-initialize)

  # Build the protobuf fuzzer
  add_clang_executable(clang-proto-fuzzer
    ${DUMMY_MAIN}
    ExampleClangProtoFuzzer.cpp
    )

  # Build the loop protobuf fuzzer
  add_clang_executable(clang-loop-proto-fuzzer
    ${DUMMY_MAIN}
    ExampleClangLoopProtoFuzzer.cpp
    )

  # Build the llvm protobuf fuzzer
  add_clang_executable(clang-llvm-proto-fuzzer
    ${DUMMY_MAIN}
    ExampleClangLLVMProtoFuzzer.cpp
    )

  set(COMMON_PROTO_FUZZ_LIBRARIES
    ${ProtobufMutator_LIBRARIES}
    ${PROTOBUF_LIBRARIES}
    ${LLVM_LIB_FUZZING_ENGINE}
    clangFuzzerInitialize
    )

  target_link_libraries(clang-proto-fuzzer
    PRIVATE
    ${COMMON_PROTO_FUZZ_LIBRARIES}
    clangHandleCXX
    clangCXXProto
    clangProtoToCXX
    )
  target_link_libraries(clang-loop-proto-fuzzer
    PRIVATE
    ${COMMON_PROTO_FUZZ_LIBRARIES}
    clangHandleCXX
    clangCXXLoopProto
    clangLoopProtoToCXX
    )
  target_link_libraries(clang-llvm-proto-fuzzer
    PRIVATE
    ${COMMON_PROTO_FUZZ_LIBRARIES}
    clangHandleLLVM
    clangCXXLoopProto
    clangLoopProtoToLLVM
    )

endif()

add_clang_subdirectory(handle-cxx)
add_clang_subdirectory(handle-llvm)

add_clang_executable(clang-fuzzer
  EXCLUDE_FROM_ALL
  ${DUMMY_MAIN}
  ClangFuzzer.cpp
  )

target_link_libraries(clang-fuzzer
  PRIVATE
  ${LLVM_LIB_FUZZING_ENGINE}
  clangHandleCXX
  )

add_clang_executable(clang-objc-fuzzer
  EXCLUDE_FROM_ALL
  ${DUMMY_MAIN}
  ClangObjectiveCFuzzer.cpp
  )

target_link_libraries(clang-objc-fuzzer
  PRIVATE
  ${LLVM_LIB_FUZZING_ENGINE}
  clangHandleCXX
  )
@


1.1.1.1
log
@Import 01f3a59fb3e2542fce74c768718f594d0debd0da from the LLVM mono-repo:
clang (without test/, unittests/, www/)
llvm (without test/, unittests/)
@
text
@@
