blob: dac1b1975067c6407131c1fde366a50fe5fbc235 [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
Vitaly Buka3fcc5462017-07-14 13:32:53 -070015set(EXPAT_CFLAGS "${CMAKE_C_FLAGS} ${FUZZING_FLAGS}")
16set(EXPAT_CXXFLAGS "${CMAKE_CXX_FLAGS} ${FUZZING_FLAGS}")
Vitaly Buka5b1a0032017-02-17 00:06:06 -080017include(expat)
18
19add_executable(expat_example
20 expat_example.cc)
21target_link_libraries(expat_example
22 protobuf-mutator-xml
Vitaly Buka53dccbe2017-10-16 18:27:21 -070023 ${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES}
Vitaly Buka5b1a0032017-02-17 00:06:06 -080024 ${EXPAT_LIBRARIES})
25set_property(TARGET expat_example
26 PROPERTY COMPILE_FLAGS ${FUZZING_FLAGS})
27set_property(TARGET expat_example
Vitaly Buka7218a152017-10-16 16:36:40 -070028 PROPERTY LINK_FLAGS ${FUZZING_FLAGS_BINARY})
Vitaly Buka5b1a0032017-02-17 00:06:06 -080029
30add_executable(expat_example_test
31 expat_example_test.cc)
32add_dependencies(expat_example_test expat_example)
33target_link_libraries(expat_example_test
34 ${GTEST_BOTH_LIBRARIES}
35 ${CMAKE_THREAD_LIBS_INIT})
36add_test(test.expat_example_test expat_example_test --gtest_color=yes AUTO)
Christian Hartlageadd10cd2018-11-16 02:17:16 +010037if(LIB_PROTO_MUTATOR_TESTING)
38 add_dependencies(check expat_example_test)
Christian Hartlage78533872018-11-27 16:22:17 +010039endif()