mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 09:27:46 +00:00
Meta: Rename Fuzzer flags to ENABLE_FUZZERS_{LIBFUZZER,OSSFUZZ}
This commit is contained in:
parent
7d51696d5d
commit
e3519b8e5c
8 changed files with 19 additions and 17 deletions
|
@ -64,7 +64,7 @@ add_compile_options(-Wall -Wextra -Werror)
|
|||
add_compile_options(-fPIC -g)
|
||||
add_compile_options(-Wno-maybe-uninitialized)
|
||||
add_compile_options(-fno-exceptions)
|
||||
if (NOT ENABLE_FUZZER_SANITIZER)
|
||||
if (NOT ENABLE_FUZZERS_LIBFUZZER)
|
||||
add_compile_options(-fno-semantic-interposition)
|
||||
endif()
|
||||
|
||||
|
@ -109,14 +109,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
|||
# Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one
|
||||
add_compile_options(-Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216)
|
||||
|
||||
if (ENABLE_FUZZER_SANITIZER)
|
||||
if (ENABLE_FUZZERS_LIBFUZZER)
|
||||
add_compile_options(-fsanitize=fuzzer -fno-omit-frame-pointer)
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer")
|
||||
endif()
|
||||
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-expansion-to-defined)
|
||||
if (ENABLE_FUZZER_SANITIZER)
|
||||
if (ENABLE_FUZZERS_LIBFUZZER)
|
||||
message(FATAL_ERROR
|
||||
"Fuzzer Sanitizer (-fsanitize=fuzzer) is only supported for Fuzzer targets with LLVM. "
|
||||
"Reconfigure CMake with -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER pointing to a clang-based toolchain"
|
||||
|
@ -173,7 +173,7 @@ function(lagom_lib library fs_name)
|
|||
|
||||
# Don't make alias when we're going to import a previous build for Tools
|
||||
# FIXME: Is there a better way to write this?
|
||||
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER)
|
||||
if (NOT ENABLE_FUZZERS_OSSFUZZ AND NOT ENABLE_FUZZERS_LIBFUZZER)
|
||||
# alias for parity with exports
|
||||
add_library(Lagom::${library} ALIAS ${target_name})
|
||||
endif()
|
||||
|
@ -272,7 +272,7 @@ install(
|
|||
# Code Generators and other host tools
|
||||
# We need to make sure not to build code generators for Fuzzer builds, as they already have their own main.cpp
|
||||
# Instead, we import them from a previous install of Lagom. This mandates a two-stage build for fuzzers.
|
||||
if (ENABLE_OSS_FUZZ OR ENABLE_FUZZER_SANITIZER)
|
||||
if (ENABLE_FUZZERS_OSSFUZZ OR ENABLE_FUZZERS_LIBFUZZER)
|
||||
find_package(Lagom REQUIRED)
|
||||
else()
|
||||
add_subdirectory(Tools)
|
||||
|
@ -483,7 +483,7 @@ if (BUILD_LAGOM)
|
|||
lagom_lib(XML xml
|
||||
SOURCES ${LIBXML_SOURCES})
|
||||
|
||||
if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
||||
if (NOT ENABLE_FUZZERS_OSSFUZZ AND NOT ENABLE_FUZZERS_LIBFUZZER AND NOT ENABLE_COMPILER_EXPLORER_BUILD)
|
||||
# Lagom Examples
|
||||
add_executable(TestApp TestApp.cpp)
|
||||
target_link_libraries(TestApp LagomCore)
|
||||
|
@ -711,6 +711,6 @@ if (BUILD_LAGOM)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_FUZZER_SANITIZER OR ENABLE_OSS_FUZZ)
|
||||
if (ENABLE_FUZZERS_LIBFUZZER OR ENABLE_FUZZERS_OSSFUZZ)
|
||||
add_subdirectory(Fuzzers)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue