CMakeLists: Put -Wfatal-errors behind a CMake flag

This commit is contained in:
MerryMage 2019-08-14 20:50:36 +01:00
parent cb971d3280
commit 6edc95e9eb

View file

@ -11,6 +11,7 @@ endif()
# Dynarmic project options # Dynarmic project options
option(DYNARMIC_ENABLE_CPU_FEATURE_DETECTION "Turning this off causes dynarmic to assume the host CPU doesn't support anything later than SSE3" ON) option(DYNARMIC_ENABLE_CPU_FEATURE_DETECTION "Turning this off causes dynarmic to assume the host CPU doesn't support anything later than SSE3" ON)
option(DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT "Enables support for systems that require W^X" OFF) option(DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT "Enables support for systems that require W^X" OFF)
option(DYNARMIC_FATAL_ERRORS "Errors are fatal" OFF)
option(DYNARMIC_TESTS "Build tests" ${MASTER_PROJECT}) option(DYNARMIC_TESTS "Build tests" ${MASTER_PROJECT})
option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF) option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF)
option(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF) option(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF)
@ -78,13 +79,17 @@ else()
-Wcast-qual -Wcast-qual
-pedantic -pedantic
-pedantic-errors -pedantic-errors
-Wfatal-errors
-Wno-missing-braces) -Wno-missing-braces)
if (DYNARMIC_WARNINGS_AS_ERRORS) if (DYNARMIC_WARNINGS_AS_ERRORS)
list(APPEND DYNARMIC_CXX_FLAGS list(APPEND DYNARMIC_CXX_FLAGS
-Werror) -Werror)
endif() endif()
if (DYNARMIC_FATAL_ERRORS)
list(APPEND DYNARMIC_CXX_FLAGS
-Wfatal-errors)
endif()
endif() endif()
# Arch detection # Arch detection