From 32da4f2504967c985f074cfe430e4a56fac2b995 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Mon, 21 Mar 2022 14:07:03 -0500 Subject: [PATCH] remove optimize and debug build options because they are redudant w/ cmake_build_type --- CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81ef0c9d2..a047cc9a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,12 +27,12 @@ endif() option(openmp "Enable shared-memory parallelism with OpenMP" ON) option(profile "Compile with profiling flags" OFF) -option(debug "Compile with debug flags" OFF) -option(optimize "Turn on all compiler optimization flags" OFF) option(coverage "Compile with coverage analysis flags" OFF) option(dagmc "Enable support for DAGMC (CAD) geometry" OFF) option(libmesh "Enable support for libMesh unstructured mesh tallies" OFF) +message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") + #=============================================================================== # MPI for distributed-memory parallelism #=============================================================================== @@ -134,18 +134,13 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) -list(APPEND cxxflags -O2) -if(debug) - list(REMOVE_ITEM cxxflags -O2) - list(APPEND cxxflags -g -O0) +if (NOT ${CMAKE_BUILD_TYPE}) + add_compile_options(-O2) endif() + if(profile) list(APPEND cxxflags -g -fno-omit-frame-pointer) endif() -if(optimize) - list(REMOVE_ITEM cxxflags -O2) - list(APPEND cxxflags -O3) -endif() if(coverage) list(APPEND cxxflags --coverage) list(APPEND ldflags --coverage)