The documentation first starts with a steps that do not specify a specific environment (https://github.com/apple/foundationdb/blob/master/README.md#compiling-from-source) so I started following it, and only found out about the Windows specific with an entire different set of step after scrolling down to the end of the page…
Followed the steps (they are a bit outdated version-wise) and had to install a few additional things. Most important was llvm-utils to make it work with cmake and VS2019: GitHub - zufuliu/llvm-utils: LLVM/Clang toolsets for Visual Studio 2022, 2019, 2017, 2015, 2013, 2012 and 2010.
EDIT : DISREGARD! This toolkit is too old, and does not work properly anymore! I swtiched to used VS ‘ClangCL’ toolset and it works better, see next message!
After downloading the LLVM_VS2017.zip from Release v20.03 · zufuliu/llvm-utils · GitHub and run install.bat, it copied the correct files for both vs2017 and vs2019. I just had to add -T "LLVM_v142"
to CMAKE and it generated the proper project files.
Though it looks like it does not enable parallel build, because the build tooki FOREVER and only used a single core. It took 1h10min and build most of the binaries though there are a few errors remaining.
While it was running I was able to confirm that the cl-lang.exe process is indeed running as x64.
"C:\Data\Git\GitHub\foundationdb\distrib\foundationdb.sln" (default target) (1) ->
"C:\Data\Git\GitHub\foundationdb\distrib\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxproj.metaproj" (default target) (76) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxproj" (default target) (81) ->
(ClCompile target) ->
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
898,48): error : conflicting types for 'GetProcessTimes' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.v
cxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
914,49): error : functions that differ only in their return type cannot be overloaded [C:\Data\Git\GitHub\foundationdb\
distrib\fdbbackup\fdbbackup.vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
915,50): error : conflicting types for 'FindFirstFileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vc
xproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
916,50): error : conflicting types for 'FindNextFileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcx
proj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
920,51): error : conflicting types for 'CreateMutexA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxp
roj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
924,48): error : conflicting types for 'UnmapViewOfFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.v
cxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
925,51): error : conflicting types for 'CreateSemaphoreA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.
vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
928,51): error : conflicting types for 'CreateFileMappingA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbacku
p.vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
931,51): error : conflicting types for 'CreateFileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxpr
oj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
932,49): error : conflicting types for 'GetSystemInfo' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcx
proj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
933,48): error : conflicting types for 'FlushViewOfFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.v
cxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
937,48): error : conflicting types for 'GetFileSizeEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcx
proj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
944,48): error : conflicting types for 'CreateDirectoryA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.
vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
946,48): error : functions that differ only in their return type cannot be overloaded [C:\Data\Git\GitHub\foundationdb\
distrib\fdbbackup\fdbbackup.vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
950,48): error : conflicting types for 'SetFilePointerEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.
vcxproj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
953,48): error : conflicting types for 'LockFileEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxpro
j]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
954,48): error : conflicting types for 'UnlockFileEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxp
roj]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
955,48): error : conflicting types for 'WriteFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxproj
]
C:\Data\Git\GitHub\foundationdb\distrib\boostProject-prefix\src\boostProject\boost/interprocess/detail/win32_api.hpp(
956,48): error : conflicting types for 'ReadFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbbackup\fdbbackup.vcxproj]
"C:\Data\Git\GitHub\foundationdb\distrib\foundationdb.sln" (default target) (1) ->
"C:\Data\Git\GitHub\foundationdb\distrib\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbservice\fdbmonitor.vcxproj.metaproj" (default target) (100) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbservice\fdbmonitor.vcxproj" (default target) (101) ->
C:\Data\Git\GitHub\foundationdb\fdbservice\FDBService.cpp(414,54): error : cannot pass object of non-trivial type 'st
d::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') through variadic function; call will abort at
runtime [-Wnon-pod-varargs] [C:\Data\Git\GitHub\foundationdb\distrib\fdbservice\fdbmonitor.vcxproj]
C:\Data\Git\GitHub\foundationdb\fdbservice\FDBService.cpp(418,54): error : cannot pass object of non-trivial type 'st
d::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') through variadic function; call will abort at
runtime [-Wnon-pod-varargs] [C:\Data\Git\GitHub\foundationdb\distrib\fdbservice\fdbmonitor.vcxproj]
C:\Data\Git\GitHub\foundationdb\fdbservice\FDBService.cpp(841,5): error : first parameter of 'main' (argument count)
must be of type 'int' [C:\Data\Git\GitHub\foundationdb\distrib\fdbservice\fdbmonitor.vcxproj]
"C:\Data\Git\GitHub\foundationdb\distrib\foundationdb.sln" (default target) (1) ->
"C:\Data\Git\GitHub\foundationdb\distrib\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj.metaproj" (default target) (102) ->
"C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj" (default target) (107) ->
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(59,1): error : conflicting types for 'Create
DirectoryA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(87,1): error : conflicting types for 'Create
FileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(233,1): error : conflicting types for 'FindF
irstFileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(322,1): error : conflicting types for 'FindN
extFileA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(651,1): error : functions that differ only i
n their return type cannot be overloaded [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(681,1): error : conflicting types for 'GetFi
leSizeEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(690,1): error : functions that differ only i
n their return type cannot be overloaded [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(984,1): error : conflicting types for 'LockF
ileEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1024,1): error : conflicting types for 'Read
File' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1150,1): error : conflicting types for 'SetF
ilePointerEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1209,1): error : conflicting types for 'Unlo
ckFileEx' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1221,1): error : conflicting types for 'Writ
eFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1462,1): error : functions that differ only
in their return type cannot be overloaded [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\synchapi.h(428,1): error : conflicting types for 'Crea
teMutexA' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\processthreadsapi.h(106,1): error : conflicting types
for 'GetProcessTimes' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\sysinfoapi.h(95,1): error : conflicting types for 'Get
SystemInfo' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\memoryapi.h(273,1): error : conflicting types for 'Flu
shViewOfFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\memoryapi.h(282,1): error : conflicting types for 'Unm
apViewOfFile' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\libloaderapi.h(186,1): error : conflicting types for '
FreeLibrary' [C:\Data\Git\GitHub\foundationdb\distrib\fdbserver\fdbserver.vcxproj]
"C:\Data\Git\GitHub\foundationdb\distrib\foundationdb.sln" (default target) (1) ->
"C:\Data\Git\GitHub\foundationdb\distrib\documentation\buildsphinx.vcxproj.metaproj" (default target) (126) ->
"C:\Data\Git\GitHub\foundationdb\distrib\documentation\buildsphinx.vcxproj" (default target) (127) ->
(CustomBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(240
,5): error MSB8066: Custom build for 'C:\Data\Git\GitHub\foundationdb\distrib\CMakeFiles\0a42c1b5e737061c329a291dcab471
e1\venv_setup.rule;C:\Data\Git\GitHub\foundationdb\distrib\CMakeFiles\2d165168042997a2d819c3db7ea1bfb5\buildsphinx.rule
' exited with code 9009. [C:\Data\Git\GitHub\foundationdb\distrib\documentation\buildsphinx.vcxproj]
2 Warning(s)
42 Error(s)