-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
CMake 3.28 and C++20, error: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND #22305
Comments
@dschuff should we start including this? This tool doesn't seem to exist on my debian-based system, is it new?
|
Ah, I found it via |
Yes, clang-scan-deps is used with C++20 modules. |
I think maybe we don't build "clang/tools" at all yet on our builder. |
I went ahead and did a minimal fix for this in https://chromium-review.googlesource.com/c/emscripten-releases/+/5402952 so the next release should be good. By the way, the non-LTO builds of emscripten-releases should have this binary in them already, so if you wanted to try it out you could use emsdk to install one of them, e.g. |
Can you provide a simple example, including CMake configuration? I always encounter errors when compiling modules! |
emscripten doesn't really have support for C++20 modules yet. Its something we should probably add tests for, but for now its not something that is easy to do. Just FYI |
Just to note, this problem prevents using CMake 3.28 (or later) with C++20 (or later), even in a project without modules. |
@Boris-Rasin I'm not seeing any iseeu with simply using C++20. For example, with the above CMakeLists.txt file I can run cmake 3.2.8 just fine:
What problems do you see when you don't use modules? |
The problem I see is listed in this bug report title: "error: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND". This happens with provided CMake file and empty "test.cpp" file. Which means it happens with a project that does not use modules. The error is during build, not during CMake config. |
Thanks! I was able to reproduce now. Uploading a fix now. |
Is this issue fixed on Windows?
I'm still getting the Is this tool included in the Windows distributions? Note: I am not using modules, but CMake doesn't seem to care. |
The fix for this has not yet landed. |
* 3.28 is not working for Clang under Ubuntu emscripten-core/emscripten#22305
Any know workaround? I can think of:
|
Workaround that imports the bits of PR#21987: https://github.com/eliemichel/cpp20-cmake-emscripten-template |
This is required to avoid issue found in: emscripten-core/emscripten#22305.
EMSDK needs to include "clang-scan-deps" tool, as CMake 3.28 with C++20 and clang compiler always runs this tool.
This CMake produces the error, test.cpp could be empty:
The text was updated successfully, but these errors were encountered: