lsquic icon indicating copy to clipboard operation
lsquic copied to clipboard

Improve document for BUILD-WINDOWS.md

Open honglei opened this issue 5 years ago • 2 comments

Just following the document BUILD-WINDOWS.md cannot build lsquic. So, I need to configure every header path and lib path manually as follows, I hope document can be improved or providing builded libs.

vcpkg install zlib:x64-windows-static
vcpkg install libevent:x64-windows-static
vcpkg install pcre:x64-windows-static

vcpkg integrate install

##BoringSSL Debug

cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 .
msbuild ALL_BUILD.vcxproj

##BoringSSL Release

cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Release -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 .
msbuild ALL_BUILD.vcxproj

##Debug

set include=X:\QUIC\vcpkg\installed\x64-windows-static\include
set vclib=X:\QUIC\vcpkg\installed\x64-windows-static\debug\lib

cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF   -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug  -DPCRE_LIB=%vclib%\pcred.lib -DPCREPOSIX_LIB=%vclib%\pcreposixd.lib  -DZLIB_INCLUDE_DIR=%include%  -DZLIB_LIB=%vclib%\zlibd.lib -DEVENT_INCLUDE_DIR=%include% -DEVENT_LIB=%vclib%\event.lib -DCMAKE_TOOLCHAIN_FILE=X:/QUIC/vcpkg/scripts/buildsystems/vcpkg.cmake   -DBORINGSSL_LIB_decrepit=X:\QUIC\boringssl\decrepit\Debug\decrepit.lib -DBORINGSSL_LIB_ssl=X:\QUIC\boringssl\ssl\Debug\ssl.lib -DBORINGSSL_LIB_crypto=X:\QUIC\boringssl\crypto\Debug\crypto.lib .

msbuild ALL_BUILD.vcxproj 

##Release

set include=X:\QUIC\vcpkg\installed\x64-windows-static\include
set vclib=X:\QUIC\vcpkg\installed\x64-windows-static\lib

cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF   -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Release  -DPCRE_LIB=%vclib%\pcre.lib -DPCREPOSIX_LIB=%vclib%\pcreposix.lib  -DZLIB_INCLUDE_DIR=%include%  -DZLIB_LIB=%vclib%\zlib.lib -DEVENT_INCLUDE_DIR=%include% -DEVENT_LIB=%vclib%\event.lib -DCMAKE_TOOLCHAIN_FILE=X:/QUIC/vcpkg/scripts/buildsystems/vcpkg.cmake   -DBORINGSSL_LIB_decrepit=X:\QUIC\boringssl\decrepit\Release\decrepit.lib -DBORINGSSL_LIB_ssl=X:\QUIC\boringssl\ssl\Release\ssl.lib -DBORINGSSL_LIB_crypto=X:\QUIC\boringssl\crypto\Release\crypto.lib .

using lsquic.sln to do ALL_BUILD

honglei avatar Jul 08 '20 07:07 honglei

Thank you for the bug report and the suggested updates. You are right: these instructions are out of date. We will fix the document.

(To build on Windows, the authoritative steps are listed in appveyor.yml, which successfully builds on Windows.)

dtikhonov avatar Jul 08 '20 12:07 dtikhonov

appveyor-windows.yml has been updated per #350

There are additional steps needed to build a shared library (dll) but CMake flags -DBUILD_SHARED_LIBS=ON -DLSQUIC_SHARED_LIB=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON is a good starting point.

I'd like to contribute an appveyor-windows-shared.yml to build it if possible @litespeedtech @dtikhonov

I'm not overly familiar with appveyor, if I make a PR with that file does any wire-up in appveyor need to be done?

Can update BUILD-WINDOWS.md at the same time and cover static and shared build instructions. It'd be nice if a newer version of CMake could be required.

TYoungSL avatar Dec 15 '21 17:12 TYoungSL