1# 2# Copyright (c) 2021, The OpenThread Authors. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12# 3. Neither the name of the copyright holder nor the 13# names of its contributors may be used to endorse or promote products 14# derived from this software without specific prior written permission. 15# 16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26# POSSIBILITY OF SUCH DAMAGE. 27# 28 29set(COMMON_INCLUDES 30 ${PROJECT_SOURCE_DIR}/include 31 ${PROJECT_SOURCE_DIR}/src/core 32) 33 34set(COMMON_COMPILE_OPTIONS 35 -DOPENTHREAD_FTD=1 36 -DOPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE=1 37) 38 39set(COMMON_SOURCES 40 fuzzer_platform.cpp 41) 42 43set(COMMON_LIBS 44 openthread-ftd 45 ${OT_MBEDTLS} 46 $ENV{LIB_FUZZING_ENGINE} 47 ot-config 48) 49 50add_executable(ot-cli-received-fuzzer 51 cli_received.cpp 52 ${COMMON_SOURCES} 53) 54 55target_compile_options(ot-cli-received-fuzzer 56 PRIVATE 57 ${COMMON_COMPILE_OPTIONS} 58) 59 60target_include_directories(ot-cli-received-fuzzer 61 PRIVATE 62 ${COMMON_INCLUDES} 63) 64 65target_link_libraries(ot-cli-received-fuzzer 66 PRIVATE 67 openthread-cli-ftd 68 ${COMMON_LIBS} 69) 70 71add_executable(ot-ip6-send-fuzzer 72 ip6_send.cpp 73 ${COMMON_SOURCES} 74) 75 76target_compile_options(ot-ip6-send-fuzzer 77 PRIVATE 78 ${COMMON_COMPILE_OPTIONS} 79) 80 81target_include_directories(ot-ip6-send-fuzzer 82 PRIVATE 83 ${COMMON_INCLUDES} 84) 85 86target_link_libraries(ot-ip6-send-fuzzer 87 PRIVATE 88 ${COMMON_LIBS} 89) 90 91add_executable(ot-radio-receive-done-fuzzer 92 radio_receive_done.cpp 93 ${COMMON_SOURCES} 94) 95 96target_compile_options(ot-radio-receive-done-fuzzer 97 PRIVATE 98 ${COMMON_COMPILE_OPTIONS} 99) 100 101target_include_directories(ot-radio-receive-done-fuzzer 102 PRIVATE 103 ${COMMON_INCLUDES} 104) 105 106target_link_libraries(ot-radio-receive-done-fuzzer 107 PRIVATE 108 ${COMMON_LIBS} 109) 110 111add_executable(ot-ncp-hdlc-received-fuzzer 112 ncp_hdlc_received.cpp 113 ${COMMON_SOURCES} 114) 115 116target_compile_options(ot-ncp-hdlc-received-fuzzer 117 PRIVATE 118 ${COMMON_COMPILE_OPTIONS} 119) 120 121target_include_directories(ot-ncp-hdlc-received-fuzzer 122 PRIVATE 123 ${COMMON_INCLUDES} 124) 125 126target_link_libraries(ot-ncp-hdlc-received-fuzzer 127 PRIVATE 128 openthread-ncp-ftd 129 ${COMMON_LIBS} 130) 131