目標版本明確
用 --gcc-version 或 --gcc 選擇目標編譯器。profile、內建巨集與 include 路徑皆來自同一個目標,不混用。
CrucibleCpp 是一個獨立的 C++ 預處理器。它會讀取原始碼檔案,完成翻譯階段 1–4,輸出可直接交給 GCC 繼續編譯的 .i 檔案。
# 使用目標 GCC 的 profile 和標頭檔進行前置處理 PS> .\cruciblecpp-preprocessor.exe --gcc-version=15 ` -P src\main.cpp -o build\main.i # 輸出可直接交給 GCC 編譯 PS> g++ -std=c++20 build\main.i -o build\main.exe PS> .\build\main.exe ✓ preprocess complete ✓ 65/65 tests · GCC 15.2 / 14.3 / 13.3
每個正例都經過同一條流程:CrucibleCpp 產生 .i,由對應的 GCC 編譯成 exe,再實際執行。行為以 GCC 15.2、14.3、13.3 為基準。
用 --gcc-version 或 --gcc 選擇目標編譯器。profile、內建巨集與 include 路徑皆來自同一個目標,不混用。
原始碼 caret、include trace、warning ID、-Werror、pragma diagnostic 堆疊,以及系統標頭檔的警告抑制。
nlohmann/json、fmt、spdlog 在三個 GCC 版本上完成預處理、編譯與執行,涵蓋真實標頭檔與巨集組合。
\uXXXX 與 \UXXXXXXXX 參與識別字、#、##;合法性檢查與輸出正規化皆與 GCC 對齊。
二進位內嵌、limit、gnu::offset、prefix、suffix、if_empty,以及 __has_embed。
GCC 13 / 14 / 15 的 PCH 策略與快取皆可使用。manifest 會記錄編譯器路徑、版本與執行檔雜湊,避免跨版本誤命中。
目前生產目標鎖定 Windows x64 + MinGW-w64 UCRT64。不同 GCC 版本使用各自的 profile 與標頭檔,輸出由對應的 GCC 實際編譯驗證。
| 目標 | 狀態 | 說明 |
|---|---|---|
GCC 15.2 | 完整 | C++11/14/17/20 profile |
GCC 14.3 | 完整 | C++11/14/17/20 profile |
GCC 13.3 | 完整 | C++11/14/17/20 profile |
| Windows x64 / UCRT64 | 支援 | 目前生產目標 |
| Linux / MSVC / Clang | 未支援 | 架構保留擴充點 |
g++.dg/cpp testsuite 持續回歸