blob: 173363cee0523804f44022b815a916fe8fe57b30 [file] [log] [blame]
Vitaly Buka5b1a0032017-02-17 00:06:06 -08001# Copyright 2017 Google Inc. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15protobuf_generate_cpp(LIB_FUZZER_EXAMPLE_PROTO_SRCS
16 LIB_FUZZER_EXAMPLE_PROTO_HDRS
17 libfuzzer_example.proto)
18add_executable(libfuzzer_example
19 libfuzzer_example.cc
20 ${LIB_FUZZER_EXAMPLE_PROTO_SRCS})
21target_link_libraries(libfuzzer_example
22 protobuf-mutator
23 ${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES})
24set_property(TARGET libfuzzer_example
25 PROPERTY COMPILE_FLAGS ${FUZZING_FLAGS})
26set_property(TARGET libfuzzer_example
27 PROPERTY LINK_FLAGS ${FUZZING_FLAGS})
28
29add_executable(libfuzzer_example_test
30 libfuzzer_example_test.cc)
31add_dependencies(libfuzzer_example_test libfuzzer_example)
32target_link_libraries(libfuzzer_example_test
33 ${GTEST_BOTH_LIBRARIES}
34 ${CMAKE_THREAD_LIBS_INIT})
35add_test(test.libfuzzer_example_test libfuzzer_example_test --gtest_color=yes AUTO)
36
37add_dependencies(check libfuzzer_example_test)