Commit e788738e authored by Dmitry Shulga's avatar Dmitry Shulga

MDEV-25543: Building failure on MacOS in case MariadDB server is compiled with XCode 12.5

Attempt to build MariaDB server on MacOS could result in
compilation errors like the following one:

  In file included from server-10.2/storage/perfschema/cursor_by_account.cc:28:
  In file included from server-10.2/include/my_global.h:287:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:309:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/type_traits:418:
    server-10.2/version:1:1: error: expected unqualified-id

    MYSQL_VERSION_MAJOR=10
    ^
  server-10.2/build.dir/include/my_config.h:529:29: note: expanded from macro 'MYSQL_VERSION_MAJOR'

This kind of compiler errors occur by the reson that compiler's system headers
contain the directive '#include <version>' and a compiler is invoked
with -I${CMAKE_SOURCE_DIR}.

The MariaDB source code root directory contains the file VERSION that is handled
by the compiler during processing the directive #include <version>
since file names on MacOS are case insensetive, so version and VERSION is treated as
the same file name.

To fix the issue the source code root directory should be removed from a list
of directories used by the compiler for include search path.
parent 24693c6f
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
# along with this program; if not, write to the Free Software Foundation, # along with this program; if not, write to the Free Software Foundation,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/sql ${CMAKE_BINARY_DIR}/sql
${PCRE_INCLUDES} ${PCRE_INCLUDES}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment