Skip to content

build_type from user profile is not respected #724

@planetmarshall

Description

@planetmarshall

Summary

The build_type specified in a user profile passed via CONAN_HOST_PROFILE is not respected and is overriden by the CMAKE_BUILD_TYPE of the parent project.

Expected Behaviour

It should be possible to build the dependencies of the project with a different build type from the project itself, for example, build a Debug project with Release dependencies. The build_type specified in a profile supplied via CONAN_HOST_PROFILE should be respected.

See also This comment - in which the expected behaviour is described as intended.

Actual Behaviour

All dependencies are built using the build type corresponding to CMAKE_BUILD_TYPE. Any settings in a custom profile are overriden.

Steps to Reproduce

Using the attached example project

  1. Run cmake --preset default

The example project specifies build_type=Debug in the profile passed to CONAN_HOST_PROFILE, but dependencies are built with build_type=Release:

======== Input profiles ========
Profile host:
[settings]
...
build_type=Release
...

Profile build:
[settings]
...
build_type=Release
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions