summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-05-09 10:32:49 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-05-09 10:32:49 +0200
commitd0785f773188b5f0eebb3135b320b2bac628f2f2 (patch)
tree3d118b4e6d61a2dbc93860ac4985c5f1ceac7f43
parente1bf1aea5cd8f8b5a1b15fd2a8ca0b8205654431 (diff)
downloadmariadb-git-d0785f773188b5f0eebb3135b320b2bac628f2f2.tar.gz
MDEV-25232 Ninja MSVC build sets default CMAKE_BUILD_TYPE to Debug
This is incosistent with other single config generators, where the default type has always been RelWithDebInfo. Fixed by moving setting of CMAKE_BUILD_TYPE right before PROJECT.
-rw-r--r--CMakeLists.txt23
1 files changed, 12 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 866792967d3..1ce95c44d92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,18 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
+
+IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+ # Setting build type to RelWithDebInfo as none was specified.
+ # Must occur before PROJECT
+ SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
+ "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
+ FORCE)
+ # Set the possible values of build type for cmake-gui
+ SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
+ "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+ENDIF()
+
PROJECT(MySQL)
# explicitly set the policy to OLD
@@ -54,17 +66,6 @@ IF(NOT DEFINED MANUFACTURER)
MARK_AS_ADVANCED(MANUFACTURER)
ENDIF()
-IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
- # Setting build type to RelWithDebInfo as none was specified.")
- SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
- "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel"
- FORCE)
- # Set the possible values of build type for cmake-gui
- SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
- "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-ENDIF()
-
-
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
IF (NOT MAX_INDEXES)
SET(MAX_INDEXES 64)