To build MariaDB you need the following:
git config --global core.autocrlf input
after the installation, otherwise some mtr tests will fail
In the "Adjusting your PATH" dialog, choose "Use Git from Windows command prompt", otherwise wrong (mingw64) git and perl will be in your PATH
C:\Program Files\GnuWin32
); the build will break due to this bison bug. Instead, install into C:\GnuWin32
. C:\GnuWin32\bin
to your system PATH
after installation. Verify that bison.exe, bzr.exe or git.exe, cmake.exe and perl.exe can be found in the PATH environment variable with "where bison
", "where git
", "where perl
" etc. from the command line prompt.
The above instructions assume MariaDB 5.5 or higher.
Branch the MariaDB bzr repository, or unpack the source archive. On the command prompt, switch to your source directory, then execute:
mkdir bld cd bld cmake .. cmake --build . --config RelWithDebInfo
The above example builds a release configured for 32 bit systems in a subdirectory named bld
. "cmake ...
" is the configuration step, "cmake --build . --config Relwithdebinfo
" is the build step.
Building Debug version is done with:
cmake --build . --config Debug
Visual Studio 2019 cmake generator will use host architecture by default, that is, with the steps above, cmake will build x64 binaries on x64 machine.
Visual Studio 2017 cmake generator will create 32 bit projects by default. For 64 bit, you must pass CMake the "generator" parameter using -G in the configuration step, e.g.:
cmake .. -G "Visual Studio 15 2017 Win64"
With Visual Studio 2019, pass -A Win32 parameter for CMake, like this
cmake .. -A Win32
With Visual Studio 2017, use corresponding 32bit generator
cmake .. -G "Visual Studio 15 2017"
For a complete list of available generators, call "cmake" without any parameters.
Instead of calling "cmake --build
" as above, open MySQL.sln
. When Visual Studio starts, choose Build/Compile.
cmake --build . --config relwithdebinfo --target package
cmake --build . --config relwithdebinfo --target MSI
Starting with MariaDB 5.2.7, it is possible to build an installer which includes 3rd party products, as described in MWL#200. Currently only HeidiSQL support is implemented; it is also included in the official builds. Use the CMake parameter -DWITH_THIRD_PARTY=HeidiSQL
to include it in the installer.
MariaDB builds optionally support authenticode code signing with an optional parameter SIGNCODE
. Use cmake -DSIGNCODE=1
during the configuration step to sign the binaries in the ZIP
and MSI
packages.
Important: for SIGNCODE=1
to work, the user that runs the build needs to install a valid authenticode digital certificate into their certificate store, otherwise the packaging step will fail.
The full script to create the release in an out-of-source build with Visual Studio with signed binaries might look like:
mkdir bld cd bld cmake .. -DSIGNCODE=1 -DWITH_THIRD_PARTY=HeidiSQL cmake --build . --config relwithdebinfo --target win_package cmake --build . --config relwithdebinfo --target MSI
This command sequence will produce a ZIP package (e.g mariadb-5.2.6-win32.zip) and MSI package (e.g mariadb-5.2.6-win32.msi) in the bld
directory.
cd C:\server\bld\mysql-test
perl mysql-test-run.pl --suite=main --parallel=auto
Assuming VS is installed on the machine
perl mysql-test-run.pl <test_name> --debugger=vsjitdebugger
If vsjitdebugger does not start, you can edit AeDebug registry key as mentioned in
Alternatively:
perl mysql-test-run.pl <test_name> --debugger=devenv
(devenv.exe needs to be in PATH)
or, if you prefer WinDBG
perl mysql-test-run.pl <test_name> --debugger=windbg
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/Building_MariaDB_on_Windows/