Skip to content

Commit

Permalink
Consistent CMake build type
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Sep 11, 2023
1 parent c1b7e3d commit 4f48f6c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,17 @@ if(DEFINED ENV{CCACHE})
set(DEFINE_CXX_CCACHE "-DCMAKE_CXX_COMPILER_LAUNCHER=$ENV{CCACHE}")
endif()

if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(DEFINE_CMAKE_BUILD_TYPE "-DCMAKE_BUILD_TYPE=RelWithDebinfo")
set(CMAKE_BUILD_TYPE "RelWithDebinfo")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_BUILD_TYPE "Debug")
endif()

execute_process(
COMMAND ${CMAKE_COMMAND}
-S cmake
-B ${BUILD_DIR}
-D COLVARS_DEBUG=${COLVARS_DEBUG}
${DEFINE_CMAKE_BUILD_TYPE}
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-D WARNINGS_ARE_ERRORS=ON
-D CMAKE_VERBOSE_MAKEFILE=ON
Expand Down Expand Up @@ -120,7 +121,7 @@ if(NOT result EQUAL 0)
message(FATAL_ERROR "Error building library.")
else()
execute_process(
COMMAND ${CMAKE_CTEST_COMMAND} -C Debug
COMMAND ${CMAKE_CTEST_COMMAND} -C ${CMAKE_BUILD_TYPE}
WORKING_DIRECTORY ${BUILD_DIR}
RESULT_VARIABLE result
)
Expand Down

0 comments on commit 4f48f6c

Please sign in to comment.