mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
CMake: Consolidate all options to the root of the project
This commit is contained in:
parent
74a65cffbd
commit
6d67c4cafc
|
@ -16,6 +16,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||
|
||||
set(SERENITY_ARCH "i686" CACHE STRING "Target architecture for SerenityOS.")
|
||||
|
||||
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
|
||||
option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" FALSE)
|
||||
option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
|
||||
option(ENABLE_FUZZER_SANITIZER "Enable fuzzer sanitizer testing in clang" FALSE)
|
||||
|
||||
add_custom_target(run
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/Meta/run.sh
|
||||
USES_TERMINAL
|
||||
|
|
|
@ -11,25 +11,21 @@ endif()
|
|||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconsumed -Wno-overloaded-virtual")
|
||||
|
||||
option(ENABLE_ADDRESS_SANITIZER "Enable address sanitizer testing in gcc/clang" FALSE)
|
||||
if (ENABLE_ADDRESS_SANITIZER)
|
||||
add_definitions(-fsanitize=address -fno-omit-frame-pointer)
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=address")
|
||||
endif()
|
||||
|
||||
option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" FALSE)
|
||||
if (ENABLE_MEMORY_SANITIZER)
|
||||
add_definitions(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
|
||||
endif()
|
||||
|
||||
option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" FALSE)
|
||||
if (ENABLE_UNDEFINED_SANITIZER)
|
||||
add_definitions(-fsanitize=undefined -fno-omit-frame-pointer)
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=undefined")
|
||||
endif()
|
||||
|
||||
option(ENABLE_FUZZER_SANITIZER "Enable fuzzer sanitizer testing in clang" FALSE)
|
||||
if (ENABLE_FUZZER_SANITIZER)
|
||||
add_definitions(-fsanitize=fuzzer -fno-omit-frame-pointer)
|
||||
set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer")
|
||||
|
|
Loading…
Reference in a new issue