rnp
rnp copied to clipboard
use vcpkg for all platforms
Description
It will be nice to use vcpkg for all our platforms to reduce the amount of shell script
Expected Behavior
This will simplify and unify the build process
Actual Behavior
For now, we have a huge amount of shell scripts related to the compilation
Agree with @CAMOBAP on vcpkg, will streamline our dependency management. Let’s get this done.
@ronaldtse yep I already have some progress in this direction and will push first PR in next 1-2 days
Thank you @CAMOBAP! Sorry didn't know you were working on it already...
@ronaldtse for the next time I will add a comment that it's in progress, to not confuse others
In Progress
I am still in the middle, here are some findings which I have so far:
- local I tested building dependencies as static libraries and shared libraries
For static deps:
vcpkg install --triplet x64-linux $(cat vcpkg.txt)cmake -B ./build -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-linux -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake .
For shared deps:
Create proper triplet file ${VCPKG_ROOT}/triplets/x64-linux-dynamic.cmake with content:
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
vcpkg install --triplet x64-linux-dynamic $(cat vcpkg.txt)cmake -B ./build -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-linux-dynamic -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake .
All this above is just for information, I will automate this in CI anyway
https://github.com/microsoft/vcpkg/issues/21461 - reported
Quick status update:
- ubuntu dynamic linking with so works tested [GCC, clang], [Debug, Release], tests passing
- https://github.com/microsoft/vcpkg/issues/21461 ready for review to fix compilation with a static library
I will wait for vcpkg's PR to approve before moving to other platforms
Thanks @CAMOBAP !
The issue with centos7 https://github.com/openssl/openssl/issues/16449 - which are probably not released yet. I will check if possible to not use openssl from vcpkg but use a system one
@CAMOBAP agree to use system OpenSSL on CentOS 7.
Just found that vcpkg has VCPKG_SYSTEM_LIBRARIES looks like exactly what we need
Just found that vcpkg has
VCPKG_SYSTEM_LIBRARIESlooks like exactly what we need
It's internal and doesn't allow to use system library instead portlet, thingking about other approach
@CAMOBAP openssl/openssl#16449 has been merged, can we carry on with this task?