Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / test / fuzzing / CMakeLists.txt
1 if (HB_CHECK)
2   file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
3   extract_make_variable (hb_fuzzer_SOURCES ${MAKEFILEAM})
4
5   # TODO: enable these two
6   #extract_make_variable (FUZZING_CPPFLAGS ${MAKEFILEAM}) # extracting regex fail
7   #add_executable (hb-fuzzer # it should be run only after ragel execution
8   #  ${project_sources} ${project_extra_sources} ${project_headers}
9   #  ${hb_fuzzer_SOURCES})
10
11   add_executable (hb-fuzzer ${hb_fuzzer_SOURCES})
12   target_link_libraries (hb-fuzzer harfbuzz)
13
14   target_compile_definitions(hb-fuzzer PUBLIC ${FUZZING_CPPFLAGS})
15   add_test (NAME hb-fuzzer
16     COMMAND python run-fuzzer-tests.py $<TARGET_FILE:hb-fuzzer>
17     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
18 endif ()