Skip to content

Commit

Permalink
Bug #31466846 RENAME THE VERSION FILE TO MYSQL_VERSION
Browse files Browse the repository at this point in the history
With new versions of boost, the build is broken on windows.
<version> is a header file which is part of C++11, but on win we
include our own VERSION instead, and the build breaks.

The solution is 'git mv VERSION MYSQL_VERSION', and adapt
cmake code accordingly.

Change-Id: I5211cf41fa83e879a25d4110dbb8933cd58da2f9
  • Loading branch information
Tor Didriksen committed Jun 10, 2020
1 parent 6653b43 commit 51675dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
File renamed without changes.
20 changes: 10 additions & 10 deletions cmake/mysql_version.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2020, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
Expand Down Expand Up @@ -28,17 +28,17 @@ SET(SHARED_LIB_MAJOR_VERSION "21")
SET(SHARED_LIB_MINOR_VERSION "1")
SET(PROTOCOL_VERSION "10")

# Generate "something" to trigger cmake rerun when VERSION changes
# Generate "something" to trigger cmake rerun when MYSQL_VERSION changes
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/VERSION
${CMAKE_SOURCE_DIR}/MYSQL_VERSION
${CMAKE_BINARY_DIR}/VERSION.dep
)

# Read value for a variable from VERSION.
# Read value for a variable from MYSQL_VERSION.

MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
IF(NOT ${var})
FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
FILE (STRINGS ${CMAKE_SOURCE_DIR}/MYSQL_VERSION str REGEX "^[ ]*${keyword}=")
IF(str)
STRING(REPLACE "${keyword}=" "" str ${str})
STRING(REGEX REPLACE "[ ].*" "" str "${str}")
Expand All @@ -59,7 +59,7 @@ MACRO(GET_MYSQL_VERSION)
IF(NOT DEFINED MAJOR_VERSION OR
NOT DEFINED MINOR_VERSION OR
NOT DEFINED PATCH_VERSION)
MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
MESSAGE(FATAL_ERROR "MYSQL_VERSION file cannot be parsed.")
ENDIF()

SET(VERSION
Expand All @@ -80,7 +80,7 @@ MACRO(GET_MYSQL_VERSION)
SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})

IF(WITH_NDBCLUSTER)
# Read MySQL Cluster version values from VERSION, these are optional
# Read MySQL Cluster version values from MYSQL_VERSION, these are optional
# as by default MySQL Cluster is using the MySQL Server version
MYSQL_GET_CONFIG_VALUE("MYSQL_CLUSTER_VERSION_MAJOR" CLUSTER_MAJOR_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_CLUSTER_VERSION_MINOR" CLUSTER_MINOR_VERSION)
Expand All @@ -89,12 +89,12 @@ MACRO(GET_MYSQL_VERSION)

# Set MySQL Cluster version same as the MySQL Server version
# unless a specific MySQL Cluster version has been specified
# in the VERSION file. This is the version used when creating
# in the MYSQL_VERSION file. This is the version used when creating
# the cluster package names as well as by all the NDB binaries.
IF(DEFINED CLUSTER_MAJOR_VERSION AND
DEFINED CLUSTER_MINOR_VERSION AND
DEFINED CLUSTER_PATCH_VERSION)
# Set MySQL Cluster version to the specific version defined in VERSION
# Set MySQL Cluster version to the specific version defined in MYSQL_VERSION
SET(MYSQL_CLUSTER_VERSION "${CLUSTER_MAJOR_VERSION}")
SET(MYSQL_CLUSTER_VERSION
"${MYSQL_CLUSTER_VERSION}.${CLUSTER_MINOR_VERSION}")
Expand All @@ -106,7 +106,7 @@ MACRO(GET_MYSQL_VERSION)
ENDIF()
ELSE()
# Set MySQL Cluster version to the same as MySQL Server, possibly
# overriding the extra version with value specified in VERSION
# overriding the extra version with value specified in MYSQL_VERSION
# This might be used when MySQL Cluster is still released as DMR
# while MySQL Server is already GA.
SET(MYSQL_CLUSTER_VERSION
Expand Down

0 comments on commit 51675dd

Please sign in to comment.