Shell commands in this document are given in PowerShell
You will need to download and install CMake. Please double-check the minimum CMake version in the root CMakeLists.txt file of this project. The version should be right at the top:
cmake_minimum_required (VERSION 3.19)You will need Perl for Windows for running code generation scripts. We tested building ESE with Strawberry Perl installed.
You will need Perl to be in your path, e.g.:
$env:Path += ";C:\Strawberry\perl\bin\"Depending on your setup, you may need to unset the PERL5LIB environment variable, e.g.:
Remove-Item Env:\PERL5LIBThe Message Compiler (mc.exe) is included in the Windows SDK.
You will need the Windows SDK to be in your path, e.g.:
$env:Path += ";C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64"We tested the following kits:
- Visual Studio Enterprise 2019 Release - amd64
- Visual Studio Build Tools 2017 Release - amd64
Please see the Visual Studio Generators article on cmake.org for more.
Once you have the dependencies installed, you can use CMake to build ESE on the command line. Note that, to prevent the CMake-generated files from appearing throughout the source tree, we build "out-of-source" by telling CMake to use the ./build/ directory.
You will first need to configure the project. The exact arguments will depend on your CMake generator. Assuming your clone of ESE is in c:\Extensible-Storage-Engine and you're using the Visual Studio Enterprise 2019 Release - amd64 kit, here's an example command:
cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Hc:/Extensible-Storage-Engine -Bc:/Extensible-Storage-Engine/build -G "Visual Studio 16 2019" -T host=x64 -A x64Build just the BstfUnitTest static library target:
cmake --build c:/Extensible-Storage-Engine/build --config Debug --target BstfUnitTest -- /maxcpucount:10Build just the BookStoreSample binary and all of its dependencies:
cmake --build c:/Extensible-Storage-Engine/build --config Debug --target BookStoreSample -- /maxcpucount:10Build everything:
cmake --build c:/Extensible-Storage-Engine/build --config Debug --target ALL_BUILD -- /maxcpucount:10If you would like to use Visual Studio Code to build ESE, here's a list of helpful extensions:
- CMake Tools - for building using CMake from within Visual Studio Code
- CMake language support - for editing of CMake files (autocomplete, documentation, syntax highlighting, etc.)
- C/C++ - you will get language services (go-to-definition, etc.) once you build the code with CMake