Skip to content

CMake: don't depend on C++ compiler for main build#323

Merged
thiagomacieira merged 1 commit intointel:mainfrom
florolf:dont-require-cxx
Apr 14, 2026
Merged

CMake: don't depend on C++ compiler for main build#323
thiagomacieira merged 1 commit intointel:mainfrom
florolf:dont-require-cxx

Conversation

@florolf
Copy link
Copy Markdown
Contributor

@florolf florolf commented Apr 13, 2026

Only the tests actually require a C++ compiler, however CXX is globally enabled for the project, which prevents building on targets that do not have a C++ compiler available.

Only enable C++ support selectively when building the tests is enabled too.

Note that I couldn't test this with MSVC, but the conditions should still work if I'm reading the CMake docs correctly.

Only the tests actually require a C++ compiler, however CXX is globally
enabled for the project, which prevents building on targets that do
not have a C++ compiler available.

Only enable C++ support selectively when building the tests is enabled
too.

Signed-off-by: Florian Larysch <fl@n621.de>
Copy link
Copy Markdown
Member

@thiagomacieira thiagomacieira left a comment

Choose a reason for hiding this comment

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

Note that I couldn't test this with MSVC, but the conditions should still work if I'm reading the CMake docs correctly.

There is no release of MSVC lacking a C++ compiler. At least as far back as I remember (Microsoft C/C++ 7.0, which was the first release of C++), it's always installed both. So if this continues to compile (AppVeyor CI), it will probably be fine.

@thiagomacieira
Copy link
Copy Markdown
Member

We can see in the "gcc-small" CI step that it did not search for the C++ compiler. So this is working.

We could add a CI step to make sure we don't break it, but...

@thiagomacieira thiagomacieira enabled auto-merge (rebase) April 13, 2026 22:53
@florolf
Copy link
Copy Markdown
Contributor Author

florolf commented Apr 13, 2026

For what it's worth, the Buildroot autobuild jobs are testing this case, which is how I found the issue in the first place. If it breaks again, somebody over there will probably notice :)

@florolf
Copy link
Copy Markdown
Contributor Author

florolf commented Apr 14, 2026

Hmm, it seems the automerge didn't trigger (possibly because I added a comment?) could you maybe poke it again @thiagomacieira? Thanks!

@thiagomacieira thiagomacieira disabled auto-merge April 14, 2026 20:38
@thiagomacieira thiagomacieira merged commit aa3420c into intel:main Apr 14, 2026
9 checks passed
@thiagomacieira
Copy link
Copy Markdown
Member

Hmm, it seems the automerge didn't trigger (possibly because I added a comment?) could you maybe poke it again @thiagomacieira? Thanks!

Done and merged.

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.

2 participants