Skip to content

[zlib] build failure #45324

Open
Open
@dsvensson

Description

@dsvensson

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

Build with VCPKG_BUILD_TYPE=debug.

Failure logs

-- Fixing pkgconfig file: C:/Users/dsven/CLionProjects/foo/vcpkg/packages/zlib_x64-windows-static-asan/debug/lib/pkgconfig/zlib.pc
CMake Error at scripts/cmake/vcpkg_replace_string.cmake:12 (file):
  file failed to open for reading (No such file or directory):

    C:/Users/dsven/CLionProjects/foo/vcpkg/packages/zlib_x64-windows-static-asan/include/zconf.h
Call Stack (most recent call first):
  ports/zlib/portfile.cmake:47 (vcpkg_replace_string)
  scripts/ports.cmake:203 (include)

Additional context

The problem happens because the header is not installed in the debug configuration:

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DSKIP_INSTALL_FILES=ON
-DZLIB_BUILD_EXAMPLES=OFF
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
)

And later in the portfile.cmake the debug include path is not taken into consideration:

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 0")
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 1")
endif()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions