-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Improve C++20 modules support #2641
Conversation
This reverts commit 8d8127b.
[Draft] Improve C++20 modules support
@Arthapz I have improved some codes. e.g. toolchain includedirs, fix bmi flags for msvc, format code and optimize performance... I still need to understand the code in depth, maybe it will take some time. |
improve generator for cxxmodules
well, you can add a shared test example in tests directory first. |
cmake generator work fine for gcc/clang now. $ xmake project -k cmake; cd build/; cmake ..; make
[ 0%]: generating.cxx.module.deps src/hello_impl.cpp
[ 0%]: generating.cxx.module.deps src/main.cpp
[ 0%]: generating.cxx.module.deps src/mod_impl.cpp
[ 0%]: generating.cxx.module.deps src/hello.mpp
[ 0%]: generating.cxx.module.deps src/mod.mpp
create ok!
-- The CXX compiler identification is GNU 11.3.0
-- The C compiler identification is GNU 11.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/xmake/tests/projects/c++/modules/dependence/build
[ 20%] Generating output_dependence_ADE56AE0
[ 0%]: generating.cxx.module.bmi mod
[ 0%]: generating.cxx.module.bmi hello
[ 20%] Built target target_dependence_ADE56AE0
[ 40%] Building CXX object CMakeFiles/dependence.dir/src/hello_impl.cpp.o
[ 60%] Building CXX object CMakeFiles/dependence.dir/src/main.cpp.o
[ 80%] Building CXX object CMakeFiles/dependence.dir/src/mod_impl.cpp.o
[100%] Linking CXX executable linux/x86_64/release/dependence
[100%] Built target dependence |
The vs generator is not currently supported because it requires all cxxflags to be fetched in advance of the config phase, but some of the module's cxxflags are dynamically added in before_build_files, so they cannot be fetched. This patch is a bit large and works mostly fine for now, so I've merged it for now, other improvements to vs generator and shared libs can be improved in a new patch separately. |
related pr
related issues