mirror of
https://github.com/MariaDB/server.git
synced 2025-08-12 20:49:12 +03:00
MDEV-10788 Not able to compile source with -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Debug
It's too plainful to require <my_config.h> to be included first for third-party storage engines. And anyway, some source files might not include <my_config.h> at all, so there is no guarantee that all parts of the binary will see identical definitions of system structures (e.g. struct stat). Define _FILE_OFFSET_BITS on the compiler's command line instead.
This commit is contained in:
@@ -341,6 +341,9 @@ INCLUDE(configure.cmake)
|
|||||||
|
|
||||||
# Common defines and includes
|
# Common defines and includes
|
||||||
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||||
|
IF(_FILE_OFFSET_BITS)
|
||||||
|
ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
|
||||||
|
ENDIF()
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||||
|
|
||||||
# Add bundled or system zlib.
|
# Add bundled or system zlib.
|
||||||
|
@@ -484,7 +484,6 @@
|
|||||||
#cmakedefine _LARGE_FILES 1
|
#cmakedefine _LARGE_FILES 1
|
||||||
#cmakedefine _LARGEFILE_SOURCE 1
|
#cmakedefine _LARGEFILE_SOURCE 1
|
||||||
#cmakedefine _LARGEFILE64_SOURCE 1
|
#cmakedefine _LARGEFILE64_SOURCE 1
|
||||||
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
|
|
||||||
|
|
||||||
#cmakedefine TIME_WITH_SYS_TIME 1
|
#cmakedefine TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
@@ -647,21 +646,4 @@
|
|||||||
#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
|
#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
|
||||||
#cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@
|
#cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@
|
||||||
|
|
||||||
/*
|
|
||||||
stat structure (from <sys/stat.h>) is conditionally defined
|
|
||||||
to have different layout and size depending on the defined macros.
|
|
||||||
The correct macro is defined in my_config.h, which means it MUST be
|
|
||||||
included first (or at least before <features.h> - so, practically,
|
|
||||||
before including any system headers).
|
|
||||||
|
|
||||||
Check the include order by looking at __GLIBC__ (defined in <features.h>)
|
|
||||||
|
|
||||||
But we cannot force all third-party clients/connectors to include
|
|
||||||
my_config.h first. So, their crashes are their responsibility,
|
|
||||||
we enable this check only for MariaDB sources (SAFE_MUTEX check).
|
|
||||||
*/
|
|
||||||
#if defined(__GLIBC__) && defined(SAFE_MUTEX)
|
|
||||||
#error <my_config.h> MUST be included first!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user