From 8667b623d3e067e26a0516675df9fbb66e5cb5a9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 3 Apr 2015 19:18:18 +0200 Subject: [PATCH] Fix invalid combinations of options rather than bomb out. Fixes #1493 --- CMakeLists.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae0274f6a..80bad7929 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,19 +30,11 @@ endfunction() # propagates CMake configuration options to the compiler function(configureProject) if (PARANOIA) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - add_definitions(-DETH_PARANOIA) - else () - message(FATAL_ERROR "Paranoia requires debug.") - endif () + add_definitions(-DETH_PARANOIA) endif () if (VMTRACE) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - add_definitions(-DETH_VMTRACE) - else () - message(FATAL_ERROR "VM tracing requires debug.") - endif () + add_definitions(-DETH_VMTRACE) endif () if (ETHASHCL) @@ -123,6 +115,17 @@ endfunction() set(CMAKE_AUTOMOC ON) cmake_policy(SET CMP0015 NEW) +# Clear invalid option +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + if (PARANOIA) + message("Paranoia requires debug - disabling for release build.") + set(PARANOIA OFF) + endif () + if (VMTRACE) + message("VM Tracing requires debug - disabling for release build.") + set (VMTRACE OFF) + endif () +endif () createDefaultCacheConfig() configureProject()