1 # 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 15 set(EXPAT_CFLAGS "${CMAKE_C_FLAGS} ${FUZZING_FLAGS}") 16 set(EXPAT_CXXFLAGS "${CMAKE_CXX_FLAGS} ${FUZZING_FLAGS}") 17 include(expat) 18 19 add_executable(expat_example 20 expat_example.cc) 21 target_link_libraries(expat_example 22 protobuf-mutator-xml 23 ${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES} 24 ${EXPAT_LIBRARIES}) 25 set_property(TARGET expat_example 26 PROPERTY COMPILE_FLAGS ${FUZZING_FLAGS}) 27 set_property(TARGET expat_example 28 PROPERTY LINK_FLAGS ${FUZZING_FLAGS_BINARY}) 29 30 add_executable(expat_example_test 31 expat_example_test.cc) 32 add_dependencies(expat_example_test expat_example) 33 target_link_libraries(expat_example_test 34 ${GTEST_BOTH_LIBRARIES} 35 ${CMAKE_THREAD_LIBS_INIT}) 36 add_test(test.expat_example_test expat_example_test --gtest_color=yes AUTO) 37 add_dependencies(check expat_example_test) 38