Skip to content

Separate release and debug builds #1626

Open
@albertziegenhagel

Description

@albertziegenhagel

Currently the tool-chain file adds both installed/<triplet>/debug and installed/<triplet> to the CMAKE_PREFIX_PATH for Debug builds but only installed/<triplet> for release builds.

Because of this it is possible that a debug build silently picks up a release library if for some reason the debug library could not be found.
An example for this is the FindGLEW.cmake script, that is distributed by VTK. This file looks for glew32.lib only, but not for glew32d.lib for debug builds, so here silently the release library is picked, and no error is being generated. In my opinion it can never be correct for a debug build to use release libraries, so ideally we should not add installed/<triplet>.

I know that with the current folder structure we need to always add installed/<triplet> so that the share and tools folder is found correctly. So in my opinion we should instead put the release libraries into a sub-folder just like the debug libraries are.

Something like this:

vcpk/
└── installed/
│   └── x64-windows/
│      ├── debug
│      │   ├── bin/
│      │   └── lib/
│      ├── release/
│      │   ├── bin/
│      │   └── lib/
│      ├── include/
│      ├── share/
│      └── tools/
...

Ports that use vcpkg_fixup_cmake_targets could be transitioned easily. Other ports should be changed to make use of vcpkg_fixup_cmake_targets.

I think if it is decided to do this change it should be done as early as possible, before even more incompatible ports will be created.

Metadata

Metadata

Assignees

Labels

category:vcpkg-bugThe issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions