Skip to content

Fix pkgcs11 vcpkg port installing both debug and release files unconditionally#1007

Open
lcruz99 wants to merge 1 commit intoOpenVPN:masterfrom
lcruz99:fix_pkcs11_helper_port_release_build
Open

Fix pkgcs11 vcpkg port installing both debug and release files unconditionally#1007
lcruz99 wants to merge 1 commit intoOpenVPN:masterfrom
lcruz99:fix_pkcs11_helper_port_release_build

Conversation

@lcruz99
Copy link

@lcruz99 lcruz99 commented Mar 26, 2026

When VCPKG_BUILD_TYPE is set (either to release or debug), windows build fails during the vcpkg install phase when building pkcs11-helper.

pkcs11-helper portfile unconditionally attempts to install both release and debug artifacts:

CMake Error at .../pkcs11-helper/portfile.cmake:30 (file):
  file INSTALL cannot find
  "C:/vcpkg/buildtrees/pkcs11-helper/x64-windows-ovpn-dbg/lib/pkcs11-helper.dll.lib"

The PR fixes this by wrapping the release and debug file(INSTALL) commands with VCPKG_BUILD_TYPE guards, consistent with the existing pattern in the pkgconfig section:

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
  file(INSTALL ...-rel/lib/pkcs11-helper.dll.lib ...)
  file(INSTALL ...-rel/lib/libpkcs11-helper-1.dll ...)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
  file(INSTALL ...-dbg/lib/pkcs11-helper.dll.lib ...)
  file(INSTALL ...-dbg/lib/libpkcs11-helper-1.dll ...)
endif()

@lcruz99 lcruz99 changed the title Fix pkgcs11 vcpkg port installing debug files on release builds Fix pkgcs11 vcpkg port installing both debug and release files unconditionally Mar 26, 2026
@lcruz99 lcruz99 marked this pull request as ready for review March 26, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant