CMake correction to "fixed OSS-Fuzz builds and added CMake targets" (28cd5d7) (#2613)

This commit is contained in:
Frank Zingsheim 2020-04-19 17:46:07 +02:00 committed by GitHub
parent e8bbfdbfee
commit 559d6fc873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1,10 +1,12 @@
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_executable(fuzz-client EXCLUDE_FROM_ALL add_executable(fuzz-client EXCLUDE_FROM_ALL
main.cpp main.cpp
type2.cpp) type2.cpp
$<TARGET_OBJECTS:simplecpp_objs_sanitized>
$<TARGET_OBJECTS:tinyxml_objs_sanitized>
$<TARGET_OBJECTS:lib_objs_sanitized>)
target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml ${CMAKE_SOURCE_DIR}/externals) target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml ${CMAKE_SOURCE_DIR}/externals)
target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer) target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer)
target_link_libraries(fuzz-client PRIVATE simplecpp_objs_sanitized tinyxml_objs_sanitized lib_objs_sanitized)
# requires CMake >= 3.13 # requires CMake >= 3.13
#target_link_options(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer) #target_link_options(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer)
target_link_libraries(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer) target_link_libraries(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer)