removed the *_sanitized targets used by fuzz-client from CMake - if you need this to be sanitized use CMAKE_CXX_FLAGS / fixed linking of fuzz-client (#2914)
This commit is contained in:
parent
f5eba39935
commit
b7c573bc9b
|
@ -2,10 +2,3 @@ file(GLOB hdrs "*.h")
|
||||||
file(GLOB srcs "*.cpp")
|
file(GLOB srcs "*.cpp")
|
||||||
|
|
||||||
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs})
|
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs})
|
||||||
# TODO: conflicts with ANALYZE_* options
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||||||
add_library(simplecpp_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs} ${hdrs})
|
|
||||||
target_compile_options(simplecpp_objs_sanitized PRIVATE -fsanitize=address)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,3 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# TODO: conflicts with ANALYZE_* options
|
|
||||||
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||||||
add_library(tinyxml2_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs} ${hdrs})
|
|
||||||
target_compile_options(tinyxml2_objs_sanitized PRIVATE -fsanitize=address)
|
|
||||||
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
|
||||||
target_compile_options(tinyxml2_objs_sanitized PRIVATE -Wno-extra-semi-stmt)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -41,10 +41,3 @@ add_library(lib_objs OBJECT ${srcs_lib} ${hdrs})
|
||||||
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
|
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
|
||||||
target_precompile_headers(lib_objs PRIVATE precompiled.h)
|
target_precompile_headers(lib_objs PRIVATE precompiled.h)
|
||||||
endif()
|
endif()
|
||||||
if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||||||
add_library(lib_objs_sanitized OBJECT EXCLUDE_FROM_ALL ${srcs_lib} ${hdrs})
|
|
||||||
target_compile_options(lib_objs_sanitized PRIVATE -fsanitize=address)
|
|
||||||
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
|
|
||||||
target_precompile_headers(lib_objs_sanitized PRIVATE precompiled.h)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -2,14 +2,20 @@ if (ENABLE_OSS_FUZZ AND 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:simplecpp_objs>
|
||||||
$<TARGET_OBJECTS:tinyxml2_objs_sanitized>
|
$<TARGET_OBJECTS:tinyxml2_objs>
|
||||||
$<TARGET_OBJECTS:lib_objs_sanitized>)
|
$<TARGET_OBJECTS:lib_objs>)
|
||||||
target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml2 ${CMAKE_SOURCE_DIR}/externals)
|
target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml2 ${CMAKE_SOURCE_DIR}/externals)
|
||||||
target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer)
|
target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer)
|
||||||
# requires CMake >= 3.13
|
# TODO: target_link_options() requires CMake >= 3.13
|
||||||
#target_link_options(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer)
|
#target_link_options(fuzz-client PRIVATE -fsanitize=fuzzer)
|
||||||
target_link_libraries(fuzz-client PRIVATE -fsanitize=address -fsanitize=fuzzer)
|
target_link_libraries(fuzz-client PRIVATE -fsanitize=fuzzer)
|
||||||
|
if (HAVE_RULES)
|
||||||
|
target_link_libraries(fuzz-client PRIVATE ${PCRE_LIBRARY})
|
||||||
|
endif()
|
||||||
|
if (USE_Z3)
|
||||||
|
target_link_libraries(fuzz-client PRIVATE ${Z3_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(translate EXCLUDE_FROM_ALL
|
add_executable(translate EXCLUDE_FROM_ALL
|
||||||
translate.cpp
|
translate.cpp
|
||||||
|
|
Loading…
Reference in New Issue