Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forcing Conan build type to match CMake one #153

Merged
merged 1 commit into from
Sep 15, 2022
Merged

Forcing Conan build type to match CMake one #153

merged 1 commit into from
Sep 15, 2022

Conversation

mous16
Copy link
Contributor

@mous16 mous16 commented Sep 14, 2022

Invoking Conan with -s build_type= parameter matching active CMake build type, or all the active ones if in multi-config scenario.

This allows CMake to correctly build targets and link to correct Conan-insatlled dependencies.

Invoking Conan with `-s build_type=` parameter matching active
CMake build type, or all the active ones if in multi-config scenario.

This allows CMake to correctly build targets and link to correct
Conan-insatlled dependencies.
@aminya
Copy link
Owner

aminya commented Sep 14, 2022

Is this desirable? I usually prefer to build the dependencies as Release unless there is an issue I need to debug in them.

@mous16
Copy link
Contributor Author

mous16 commented Sep 15, 2022

Is this desirable? I usually prefer to build the dependencies as Release unless there is an issue I need to debug in them.

I thought the same, until I stumbled across MSVC, which builds iterators with some additional introspection features when in Debug mode, making them not binary compatible with Release mode builded ones. Here more infos abaout.
So, tring to link a debug executable with a non debug library results in errors.

Moreover, using Ninja in multi-config mode, together with Conan with cmake_find_package_multi generator, causes CMake to generate only <MODULE>-release.cmake file, making it impossible to build in Debug mode (nor in RelWithDebInfo or MinSizeRel).

I'll try to upload a minimal example as soon as possible.

Copy link
Owner

@aminya aminya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!

@aminya aminya merged commit db0dd9c into aminya:main Sep 15, 2022
@aminya
Copy link
Owner

aminya commented Sep 15, 2022

Feel free to add the example as a test.

@mous16 mous16 deleted the conan-multi-build branch September 15, 2022 08:33
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.

None yet

2 participants