• Dmitry Shulga's avatar
    MDEV-25543: Building failure on MacOS in case MariadDB server is compiled with XCode 12.5 · e788738e
    Dmitry Shulga authored
    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.
    e788738e
CMakeLists.txt 5.28 KB