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

[FR] NDK build supports C++ modules #1855

Open
yujincheng08 opened this issue Mar 30, 2023 · 9 comments
Open

[FR] NDK build supports C++ modules #1855

yujincheng08 opened this issue Mar 30, 2023 · 9 comments

Comments

@yujincheng08
Copy link

Description

CMake 3.26 with clang-16 provides preliminary support for c++ modules now, and for NDK we can specify the cmake version and CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS to enjoy c++ modules. But, for NDK build project, it does not look like an easy job to add c++ modules support from the user side.

@kaizer1
Copy link

kaizer1 commented Jul 13, 2023

So in the end, is there support for modules or not? Can eat an example of successful implementation?

@DanAlbert
Copy link
Member

It's not something we currently have the resources to investigate for ndk-build. If you use CMake that doesn't matter: https://www.kitware.com/import-cmake-c20-modules/

@yujincheng08

This comment was marked as off-topic.

@DanAlbert

This comment was marked as off-topic.

@yujincheng08

This comment was marked as off-topic.

@kaizer1

This comment was marked as off-topic.

@yujincheng08

This comment was marked as off-topic.

@DanAlbert

This comment was marked as off-topic.

@nickbeth
Copy link

nickbeth commented Feb 6, 2024

I've recently tested C++20 modules support in the latest ndk release, and there seems to be a bug in the clang driver preventing it to work. I have correctly set up modules in CMake 3.28, but the clang driver is unable to find it during compilation and fails with the usual module not found error at the import site.
After multiple tries, I replaced the clang.exe and clang++.exe executables inside the ndk bin dir with ones from the LLVM release 17.0.2, and that worked. I assume there must be some patch that was left out when bundling the ndk that fixed that issue for clang, so all we need to do is wait for LLVM upstream changes to be pulled in the next ndk release and try again.

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