From 712bca76da125c682fcf186644ec87bf0075a46e Mon Sep 17 00:00:00 2001 From: lighta Date: Thu, 17 Dec 2020 12:38:19 +0100 Subject: [PATCH] Add default for CMake build type (#5586) Add valgrind to dockerfile --- CMakeLists.txt | 11 +++++++++++ tools/docker/Dockerfile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 764c96887a..edc63e49e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,17 @@ set(CMAKE_CXX_CREATE_SHARED_LIBRARY) set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_RELEASE_POSTFIX "r") +# Set a default build type if none was specified +set(default_build_type "Release") +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + # # Prevent building in the source directory by default # diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index c1004538a2..c983761983 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -1,4 +1,4 @@ FROM alpine:3.11 WORKDIR /rathena -RUN apk add --no-cache git cmake make gcc g++ gdb zlib-dev mariadb-dev ca-certificates linux-headers bash +RUN apk add --no-cache git cmake make gcc g++ gdb zlib-dev mariadb-dev ca-certificates linux-headers bash valgrind ENTRYPOINT [ "bash" ]