Skip to content

build: explicitly disable cl.exe - #36839

Open
bartoli wants to merge 1 commit into
bitcoin:masterfrom
bartoli:disable_cl_cmake
Open

bartoli wants to merge 1 commit into
bitcoin:masterfrom
bartoli:disable_cl_cmake

Conversation

@bartoli

@bartoli bartoli commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Since 4f1e6de (#31507), cmake for visual studio can only generate projects that use clang-cl.
But calling cmake without '--preset windows' or '-T ClangCL' still silently generates projects that cannot build anymore.

For example, a build with cl now fails in minisketchwrapper.c because we don't pass anymore a cl option to set __cplusplus value properly.

I propose we explicitly tell at cmake time that this can't work anymore. If not, a lot of windows devs who use cmake without presets will lose time on this.

@DrahtBot

DrahtBot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36033 ([wip,nomerge,rfc] build: Require C++23 compiler by maflcko)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@bartoli
bartoli force-pushed the disable_cl_cmake branch 2 times, most recently from 1b0d60e to deb118b Compare November 11, 2026 18:38
Comment thread CMakeLists.txt Resolved

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not opposed to this change. However, I do have some concerns.

I propose we explicitly tell at cmake time that this can't work anymore.

There are compilers we do not support, yet none of them is explicitly banned. Banning one would make it harder for someone to experiment with it.

FWIW, there is a nightly build that uses cl.exe.

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

Anyway, I wouldn't want to put Windows devs off merely for the reasons I stated above.

@maflcko

maflcko commented Nov 12, 2026

Copy link
Copy Markdown
Member

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning.

@bartoli

bartoli commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

If not, a lot of windows devs who use cmake without presets will lose time on this.

The documentation should help.

In theory, it could be a warning that the compiler is not supported (link to docs) and should only be used at their own risk? However, I am not sure if someone not reading the docs to start will read the warning.

Well, i was not thinking about someone setting up a new build environement; that person should read the doc indeed. But about the devs that already have a custom build env, and will not read the doc at each pull

FWIW, there is a nightly build that uses cl.exe.

It seems they added patches to workaround the change in the main repo : hebasto/bitcoin-core-nightly@727b9af

Comment thread CMakeLists.txt Resolved
Since 4f1e6de, cmake for visual studio can only generate projects that
use clang-cl.
But calling cmake without '--preset windows' or '-T ClangCL' still
silently generates projects that cannot build anymore.

Explicitly print a fatal error at cmake time if cl.exe is selected and
point to the doc.
@fanquake

fanquake commented Dec 1, 2026

Copy link
Copy Markdown
Member

What is the status here? A number of comments but no actual Concept/Approach indication?

@maflcko maflcko added the Windows label Dec 1, 2026
@maflcko

maflcko commented Dec 1, 2026

Copy link
Copy Markdown
Member

I think it is fine to print this error for people who run into this, but I am not sure how common such a setup without the presets is.

Would be good to have the Windows reviewers give a look here.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants