Skip to content

Instantly share code, notes, and snippets.

@kotatsuyaki
Created May 26, 2022 02:55
Show Gist options
  • Save kotatsuyaki/fe37910f94536452cab5472c60708b8c to your computer and use it in GitHub Desktop.
Save kotatsuyaki/fe37910f94536452cab5472c60708b8c to your computer and use it in GitHub Desktop.
Using C++ modules with GCC 12
import <iostream>;
int main() {
std::cout << "Hello modules\n";
return 0;
}
.POSIX:
CXX = g++
CXXFLAGS = -std=c++20 -fmodules-ts
main: gcm.cache main.cpp
$(CXX) $(CXXFLAGS) main.cpp -o main
gcm.cache:
$(CXX) $(CXXFLAGS) -c -x c++-system-header iostream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment