Documentation Home
MySQL Internals Manual

MySQL Internals Manual  /  ...  /  For Developers: How to Write Platform Checks

4.4.8 For Developers: How to Write Platform Checks

If you modify MySQL source and want to add a new platform check, please read first. In MySQL, most of the platform tests are implemented in configure.cmake and the template header file, config.h.cmake.

Bigger chunks of functionality, for example, non-trivial macros, are implemented in files in the cmake subdirectory.

For people with an Autotools background, it is important to remember that CMake does not provide autoheader functionality. For example, if you add this check to config.cmake:


Then you must also need to add the following line to config.h.cmake:

#cmakedefine HAVE_FOO 1

Useful bits:

  • Check for existence of C/C++ compiler flags with CHECK_C_COMPILER_FLAG and CHECK_CXX_COMPILER_FLAG.

Here is an example that checks for (hypothetical) -foo flag support in the C compiler, and adding it to C flags if the flag is supported:


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.