conan-package-tools icon indicating copy to clipboard operation
conan-package-tools copied to clipboard

Add common builds adds MT AND MD when there's no shared option

Open jmarrec opened this issue 6 years ago • 2 comments

Description of Problem, Request, or Question

When you don't have a shared_option_name, and when dll_with_static_runtime=False, you still end up with both MT/MTd and MD/MDd builds.

I'm wondering if it shouldn't only be MD and MDd.

Environment Details

  • Conan Package Tools Version: 0.29.0
  • Operating System: Windows
  • Docker image: Visual Studio 2017

Steps to reproduce (Include if Applicable)

I used CONAN_BUILD_TYPES=Release,Debug, I specified CONAN_VISUAL_VERSIONS=15, and CONAN_ARCHS=x86_64. My build.py is builder = bincrafters.build_template_default.get_builder(build_policy="outdated").

https://github.com/bincrafters/bincrafters-package-tools/blob/master/bincrafters/build_template_default.py#L8

https://github.com/conan-io/conan-package-tools/blob/3cd84876dd8191fd675a397a954786199f0f3502/cpt/builds_generator.py#L279:L300

I end up with

+--------+--------------+--------------------+--------------------+---------------+ | arch | build_type | compiler.runtime | compiler.version | compiler | |--------+--------------+--------------------+--------------------+---------------| | x86_64 | Release | MT | 15 | Visual Studio | | x86_64 | Release | MD | 15 | Visual Studio | | x86_64 | Debug | MTd | 15 | Visual Studio | | x86_64 | Debug | MDd | 15 | Visual Studio | +--------+--------------+--------------------+--------------------+---------------+

I'm wondering if based on the above, it shouldn't only be MD and MDd.

Build logs (Include if Available)

jmarrec avatar Jul 31 '19 14:07 jmarrec

/cc @uilianries

SSE4 avatar Jul 31 '19 14:07 SSE4

Hi @jmarrec !

By default CPT starts with all possible combinations and filter them by available arguments, options and so on.

The shared_option_name is automatic. It will check two situations, the parameter from ConanMultiPackager, and the recipe. If the recipes contains the option shared, but shared_option_name is not declared in build.py, it will consider all shared libraries. To disable it, you need to force with False: shared_option_name=False

The option dll_with_static_runtime, as the name suggests, is only related to shared build.

Your example shows static libraries using MT which is a valid configuration.

uilianries avatar Sep 10 '19 20:09 uilianries