When building with tests, turn off optimiations

Debugging failing tests is awful when optimizations are turned on.

Signed-off-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
Rick Altherr 2017-11-17 22:53:58 -08:00 committed by Tim 'mithro' Ansell
parent 30a1e466d3
commit 62dd2f94a5
1 changed files with 4 additions and 1 deletions

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5.0)
project(prjxray)
option(PRJXRAY_BUILD_TESTING "" ON)
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror ${CMAKE_CXX_FLAGS} -O3" )
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror ${CMAKE_CXX_FLAGS}" )
# Hack for missing option in cctz
option(BUILD_TESTING "" OFF)
@ -11,6 +11,9 @@ option(BUILD_TESTING "" OFF)
if(PRJXRAY_BUILD_TESTING)
enable_testing()
add_compile_options(-O0 -g)
else()
add_compile_options(-O3)
endif()
add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)