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 eebd432 commit e688cf7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ 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")
endif()
set(CMAKE_BUILD_TYPE "RelWithDebinfo")

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 +118,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 e688cf7

Please sign in to comment.