Skip to content

Latest commit

 

History

History

BUILD

This directory used to contain lots of build scripts for building
MySQL on various platforms. They are mostly gone, use cmake instead.

Some scripts have been kept for backward compatibility (other scripts
depend on them). Others have been kept to illustrate how to enable
gcov or gprof, or explicitly selecting 64bit architecture.  If you
want to use these scripts for building, you may want to speed things
up a bit by setting environment variable MAKEFLAGS="-j8"
(or some other number/flag depending on your environment)

The recommended way to build MySQL for developers:

cd <some build directory>
cmake <path to source directory>
make

This will give you a release build, with compiler options taken from
../cmake/build_configurations/compiler_options.cmake
and "feature set" taken from
../cmake/build_configurations/feature_set.cmake

Adding -DWITH_DEBUG=1 to the cmake command line gives you a debug build.


Building on Windows is slightly different:
cd <some build directory>
cmake <path to source directory>

cmake --build . --config Debug
or
cmake --build . --config RelWithDebInfo


If you have special needs, you can disable the defaults by setting
these cmake variables off:

WITH_DEFAULT_COMPILER_OPTIONS
WITH_DEFAULT_FEATURE_SET

Note: For building with unit tests, you need to tell cmake where to find
the sources, see ../unittest/gunit/CMakeLists.txt
You should *not* 'make install' googletest/googlemock on your system,
the libraries must be built from source, with the unit tests.