..
C++20_module
参考
- https://ubuntuhandbook.org/index.php/2023/09/how-to-install-clang-17-or-16-in-ubuntu-22-04-20-04/
基于ubuntu22.04LTS
1.更新CMAKE
最好将cmake更新到3.28版本以上
2.更新编译器
这里建议用 clang (我选择了clang18),因为gcc虽然支持,但是 cppreference 的 demo 无法跑通,可能是实现上有差异
安装最新的编译器
$ wget https://apt.llvm.org/llvm.sh
$ chmod u+x llvm.sh
# 通过修改参数可以安装clang16、17或者18
$ sudo ./llvm.sh 18
3.添加module需要的编译器依赖
$ sudo apt update
# 添加配套的依赖
$ sudo apt install clang-tools-18
# 为系统环境添加软链接
$ sudo ln -s /usr/bin/clang-scan-deps-18 /usr/bin/clang-scan-deps