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

[bug] NMake toolchain works with CLang-cl incorrectly #17491

Open
molotok-sms opened this issue Dec 17, 2024 · 3 comments
Open

[bug] NMake toolchain works with CLang-cl incorrectly #17491

molotok-sms opened this issue Dec 17, 2024 · 3 comments
Assignees

Comments

@molotok-sms
Copy link

Describe the bug

Hi! Thank you for your great project!

I faced with the following issue.

Context:

  • Conan supports CLang-cl and knows how to set debug parameters for it (for example, gline-tables-only and fno-inline);
  • Conan has NMakeToolchain and supports NMake;

Issue:

  • Conan sets the generated CLang build_type_flags to the CL environment variable (it's okay because CLang-cl supports it) and does it in the MSVC CL compiler format (Conan tranforms - characters to /) and that is the problem.

I see some possible solutions:

  1. Disable transformations in NMakeToolchain if the compiler is CLang-cl;
  2. Follow the previous point and to add the filling of the CFLAGS environment variable instead of the CL one.

Thank you!

How to reproduce it

No response

@memsharded memsharded self-assigned this Dec 17, 2024
@memsharded
Copy link
Member

Hi @molotok-sms

Hi! Thank you for your great project!

Thanks for your kind words!

Thanks for your report too.

I think this was addressed in #17387, which was released in latest Conan 2.10.
The way it works is it uses the tools.build:compiler_executables information to see if it is using clang-cl or not, and avoid using the wrong flags.

Could you please try that? Thanks for your feedback!

@molotok-sms
Copy link
Author

Thank you for the quick response!

I use the Conan version 2.10.0 from Pixi (Conda).
The mentioned changes are good but unfortunately it isn't enough.

In my case, "the right clang flags" pass through the NMakeToolchain "_format_options" function and become invalid.
It seems it would be good to improve the NMakeToolchain to support not only "msvc" compiler, but "clang-cl' too.

@molotok-sms
Copy link
Author

I attached the log of errors when NMakeToolchain transformed the format of debug parameters:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants