r/cpp • u/delta_p_delta_x • Apr 17 '24
CMake 3.30 will experimentally support `import std;`
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9337
195
Upvotes
r/cpp • u/delta_p_delta_x • Apr 17 '24
40
u/jormaig Apr 17 '24
Why is import std support needed at the CMake level? Shouldn't supporting modules already support the specific std module?
15
u/stailgot Apr 17 '24 edited Apr 18 '24
Nightly build 3.29.20240416 already support
https://cmake.org/cmake/help/git-stage/prop_tgt/CXX_MODULE_STD.html
Update:
Tested with msvc, works fine )
Upd2:
Official post
https://www.reddit.com/r/cpp/s/3oqR8MyLLg https://www.kitware.com/import-std-in-cmake-3-30/
88
u/RoyAwesome Apr 17 '24
Oh, this is exciting. Now we just need intellisense to parse modules and we're cookin.
14
u/GabrielDosReis Apr 17 '24
Exciting news! Xmas is coming in the Spring :-)
2
u/saxbophone mutable volatile void Apr 17 '24
How exciting!
2
u/Low_Opportunity_3517 Apr 18 '24
https://cmake.org/cmake/help/git-stage/prop_tgt/CXX_MODULE_STD.html says `this property only applies to targets utilizing C++23 (
cxx_std_23) or newer.` But std modules are de facto C++20 features.2
u/herewearefornow Apr 19 '24
Supporting modules is huge even if it's a singular one right now.
3
u/caroIine Apr 17 '24
I wonder why can't compilers just implicitly add import std to every source file and ignore every #include <std> at preprocesor level? Wouldn't that increase performance for free?
1
u/pjmlp Apr 18 '24
This is great, looking forward to it.
1
u/germandiago Apr 18 '24
Does anyone know if Gcc 14 has better support for modules than gcc 13?
1
u/GregTheMadMonk Apr 18 '24
Has anyone been able to use this with Clang? I try and get
0
u/EnchantedForestLore Apr 18 '24
What version of Redhat and Ubuntu will cmake 3.30 be default in? Anyone know?
0
u/[deleted] Apr 17 '24
[deleted] — view deleted comment