conan-io / conan-package-tools

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)
MIT License
166 stars 71 forks source link

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

Open jmarrec opened 5 years ago

jmarrec commented 5 years ago

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

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)

SSE4 commented 5 years ago

/cc @uilianries

uilianries commented 5 years ago

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.