Enable TLS Support for Windows (main)

This commit is contained in:
Mohamed Oulmahdi 2022-01-17 09:46:33 +01:00
parent 95d1a847d6
commit b0f4c65388
2 changed files with 16 additions and 32 deletions

View File

@ -168,32 +168,17 @@ $SRCDIR/packaging/osx/buildpkg.sh . $SRCDIR
### Windows ### Windows
Under Windows, the build instructions are very similar, with the main difference Under Windows, only Visual Studio with ClangCl is supported
that Visual Studio is used to compile.
1. Install Visual Studio 2017 (Community Edition is tested) 1. Install Visual Studio 2019 (IDE or Build Tools), and enable llvm support
1. Install cmake Version 3.12 or higher [CMake](https://cmake.org/) 1. Install [CMake 3.15](https://cmake.org/) or higher
1. Download version 1.72 of [Boost](https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2) 1. Download [Boost 1.77.0](https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.7z)
1. Unpack boost (you don't need to compile it) 1. Unpack boost to C:\boost, or use `-DBOOST_ROOT=<PATH_TO_BOOST>` with `cmake` if unpacked elsewhere
1. Install [Mono](http://www.mono-project.com/download/stable/) 1. Install [Python](https://www.python.org/downloads/) if is not already installed by Visual Studio
1. (Optional) Install a [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html). FoundationDB currently builds with Java 8 1. (Optional) Install [OpenJDK 11](https://developers.redhat.com/products/openjdk/download) to build Java bindings
1. Set `JAVA_HOME` to the unpacked location and JAVA_COMPILE to 1. (Optional) Install [OpenSSL 3.x](https://slproweb.com/products/Win32OpenSSL.html) to build with TLS support
`$JAVA_HOME/bin/javac`. 1. (Optional) Install [WIX Toolset](http://wixtoolset.org/) to build Windows installer
1. Install [Python](https://www.python.org/downloads/) if it is not already installed by Visual Studio 1. `mkdir build && cd build`
1. (Optional) Install [WIX](http://wixtoolset.org/). Without it Visual Studio 1. `cmake -G "Visual Studio 16 2019" -A x64 -T ClangCl <PATH_TO_FOUNDATIONDB_SOURCE>`
won't build the Windows installer 1. `msbuild /p:Configuration=Release foundationdb.sln`
1. Create a build directory (you can have the build directory anywhere you 1. To increase build performance, use `/p:UseMultiToolTask=true` and `/p:CL_MPCount=<NUMBER_OF_PARALLEL_JOBS>`
like): `mkdir build`
1. `cd build`
1. `cmake -G "Visual Studio 15 2017 Win64" -DBOOST_ROOT=<PATH_TO_BOOST> <PATH_TO_FOUNDATIONDB_DIRECTORY>`
1. This should succeed. In which case you can build using msbuild:
`msbuild /p:Configuration=Release foundationdb.sln`. You can also open the resulting
solution in Visual Studio and compile from there. However, be aware that
using Visual Studio for development is currently not supported as Visual
Studio will only know about the generated files. `msbuild` is located at
`c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe` for Visual Studio 15.
If you installed WIX before running `cmake` you should find the
`FDBInstaller.msi` in your build directory under `packaging/msi`.
TODO: Re-add instructions for TLS support [#3022](https://github.com/apple/foundationdb/issues/3022)

View File

@ -25,6 +25,9 @@ if(DISABLE_TLS)
set(WITH_TLS OFF) set(WITH_TLS OFF)
else() else()
set(OPENSSL_USE_STATIC_LIBS TRUE) set(OPENSSL_USE_STATIC_LIBS TRUE)
if(WIN32)
set(OPENSSL_MSVC_STATIC_RT ON)
endif()
find_package(OpenSSL) find_package(OpenSSL)
if(OPENSSL_FOUND) if(OPENSSL_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
@ -34,10 +37,6 @@ else()
message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it") message(STATUS "You can set OPENSSL_ROOT_DIR to help cmake find it")
set(WITH_TLS OFF) set(WITH_TLS OFF)
endif() endif()
if(WIN32)
message(STATUS "TLS is temporarilty disabled on Windows while libressl -> openssl transition happens")
set(WITH_TLS OFF)
endif()
endif() endif()
################################################################################ ################################################################################