Skip to content

Commit

Permalink
Add RelWithDebInfo support (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmey authored and letmaik committed May 16, 2019
1 parent 440e9b2 commit 07ee308
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enable_testing()
# User options #
########################

set(BUILD_TYPE_VALUES Debug Release)
set(BUILD_TYPE_VALUES Debug Release RelWithDebInfo)
if (CMAKE_CONFIGURATION_TYPES) # multi-config generators like MSVC
set(CMAKE_CONFIGURATION_TYPES ${BUILD_TYPE_VALUES} CACHE TYPE INTERNAL FORCE)
else()
Expand Down Expand Up @@ -157,9 +157,11 @@ endif()

set(CMAKE_C_FLAGS_DEBUG "${C_debug} ${C_checked}")
set(CMAKE_C_FLAGS_RELEASE "${C_optimized}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${C_optimized} ${C_debug}")
set(CMAKE_C_FLAGS "${C_other}")
set(CMAKE_Fortran_FLAGS_DEBUG "${Fortran_debug} ${Fortran_checked}")
set(CMAKE_Fortran_FLAGS_RELEASE "${Fortran_optimized}")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${Fortran_optimized} ${Fortran_debug}")
set(CMAKE_Fortran_FLAGS "${Fortran_preprocess} ${Fortran_io} ${Fortran_other}")

if (OPTIMIZE_C)
Expand All @@ -169,6 +171,8 @@ endif()
if (ENABLE_RUNTIME_CHECKS)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${C_checked}")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} ${Fortran_checked}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${C_checked}")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} ${Fortran_checked}")
endif()

if (SAVE_TEMPS)
Expand Down
4 changes: 2 additions & 2 deletions doc/cmake/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ By default WRF-CMake will compile in `serial` mode with `basic` nesting option.
|----|-------|-------|-----------|
|`MODE`|`serial`, `dmpar`, `smpar`, `dm_sm`|`serial`|Serial/parallel modes|
|`NESTING`|`none`, `basic`, `vortex`, `following`|`basic`|Domain Options|
|`CMAKE_BUILD_TYPE`|`Release`, `Debug`|`Release`|Whether to optimise/build with debug flags.|
|`CMAKE_BUILD_TYPE`|`Release`, `Debug`, `RelWithDebInfo`|`Release`|Whether to optimise/build with debug flags.|
|`ENABLE_RUNTIME_CHECKS`|`ON`, `OFF`|`OFF`|Whether to enable compiler runtime checks in Release mode.|
|`ENABLE_GRIB1`|`ON`, `OFF`|`ON`|Enable/Disable GRIB 1 support.|
|`ENABLE_GRIB2`|`ON`, `OFF`|`ON`|Enable/Disable GRIB 2 support.|
Expand Down Expand Up @@ -108,7 +108,7 @@ where `<install_directory>` is the directory where to install WPS and `<wrf_cmak

|Name|Options|Default|Description|
|----|-------|-------|-----------|
|`CMAKE_BUILD_TYPE`|`Release`, `Debug`|`Release`|Whether to optimise/build with debug flags.|
|`CMAKE_BUILD_TYPE`|`Release`, `Debug`, `RelWithDebInfo`|`Release`|Whether to optimise/build with debug flags.|
|`ENABLE_RUNTIME_CHECKS`|`ON`, `OFF`|`OFF`|Whether to enable compiler runtime checks in Release mode.|
|`ENABLE_GRIB1`|`ON`, `OFF`|`OFF`|Enable/Disable GRIB 1 support (`ungrib` always has GRIB 1).|
|`ENABLE_GRIB2_PNG`|`ON`, `OFF`|`ON`|Enable/Disable GRIB 2 PNG support.|
Expand Down

0 comments on commit 07ee308

Please sign in to comment.