You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not possible to pass debug/release-specific linker flags to dynamic library builds. In practice I use release linker flags to fine-tune link-time optimisation with MSVC and Clang and debug linker flags to link with sanitiser runtimes.
Ports can use these flags via CMake built-in variables CMAKE_SHARED_LINKER_FLAGS_DEBUG and CMAKE_SHARED_LINKER_FLAGS_RELEASE. In fact, boost-modular-build for example already respects these variables while generating build config for b2). The only piece missing is to forward VCPKG_LINKER_FLAGS_RELEASE and VCPKG_LINKER_FLAGS_DEBUG variables from triplets to CMake.
Proposed solution
Forward the mentioned variables from triplet to project in scripts/cmake/vcpkg_configure_cmake.cmake
Setup appropriate CMake variables (e.g. CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT and CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT) in toolchain files (scripts/toolchains).
I use this approach in my Vcpkg fork, could make a PR.
The text was updated successfully, but these errors were encountered:
Problem
Currently it is not possible to pass debug/release-specific linker flags to dynamic library builds. In practice I use release linker flags to fine-tune link-time optimisation with MSVC and Clang and debug linker flags to link with sanitiser runtimes.
Ports can use these flags via CMake built-in variables
CMAKE_SHARED_LINKER_FLAGS_DEBUG
andCMAKE_SHARED_LINKER_FLAGS_RELEASE
. In fact,boost-modular-build
for example already respects these variables while generating build config forb2
). The only piece missing is to forwardVCPKG_LINKER_FLAGS_RELEASE
andVCPKG_LINKER_FLAGS_DEBUG
variables from triplets to CMake.Proposed solution
scripts/cmake/vcpkg_configure_cmake.cmake
CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT
andCMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT
) in toolchain files (scripts/toolchains
).I use this approach in my Vcpkg fork, could make a PR.
The text was updated successfully, but these errors were encountered: