CMake: don't depend on C++ compiler for main build#323
CMake: don't depend on C++ compiler for main build#323thiagomacieira merged 1 commit intointel:mainfrom
Conversation
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>
thiagomacieira
left a comment
There was a problem hiding this comment.
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.
|
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... |
|
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 :) |
|
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. |
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.