• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Sunrisepeak
V2EX  ›  程序员

最近给 专门为 C++模块化打造的构建工具 增加了 gcc16/mingw 支持, 可以一键在 Linux 上构建出 windows 的 exe 程序, 欢迎体验 mcpp

  •  
  •   Sunrisepeak ·
    Sunrisepeak · 9 days ago · 1044 views

    mcpp 构建工具, 对增加了更多工具链的支持 目前已经覆盖主流的 linux/macos/winodws 支持部分的 跨 cpu 架构和操作系统的 交叉编译构建 C++项目, 欢迎大家体验反馈


    最小验证 + 支持的工具链集合

    mcpp new hello && cd hello
    mcpp build --target x86_64-windows-gnu
    wine target/../hello.exe
    

    Target Convention toolchain Status
    x86_64-linux-gnu gcc (Linux default) or llvm
    x86_64-linux-musl gcc 16, fully static
    aarch64-linux-musl gcc 16, fully static — cross from x86_64 (qemu-verified) or native
    x86_64-windows-gnu gcc 16 MinGW-w64 — native on Windows, cross from Linux (wine-verified)
    x86_64-windows-msvc msvc@system (detected VS/BuildTools) or llvm ¹ (Windows default)
    aarch64-macos llvm (macOS default)
    riscv64-linux-musl 🔄
    aarch64-linux-gnu 🔄
    x86_64-macos 🔄

    ✅ verified — CI builds and executes the artifact end-to-end (qemu/wine included) | 🔄 planned

    5 replies    2026-07-18 23:40:17 +08:00
    c0xt30a
        1
    c0xt30a  
       9 days ago
    问一下 OP ,对于以 dll 发布的第三方库 (vc),可以支持么?如果可以就太好了。
    Sunrisepeak
        2
    Sunrisepeak  
    OP
       8 days ago
    @c0xt30a 是指库 dll 在 mcpp 包索引进行分发 (这个是支持的) 还是指 支持在 linux 上构建 windows 的 dll 可以提一个 issue: https://github.com/mcpp-community/mcpp/issues
    cnbatch
        3
    cnbatch  
       7 days ago
    cnbatch
        4
    cnbatch  
       7 days ago
    想知道一件事,交叉编译的时候,是不是能自动处理目标平台的特有调用?

    例如 boost-asio ,在 Windows 用 IOCP ,在 BSD 和 mac 用 kqueue ,在 Linux 用 epoll ,交叉编译的时候能够正确使用系统调用吧?
    Sunrisepeak
        5
    Sunrisepeak  
    OP
       6 days ago
    @cnbatch mcpp 这个工程描述文件不对不同平台有不同配置, 并且如果同一个平台有多个可选功能。mcpp 还有 feature 机制 例如 imgui

    使用默认配置

    [dependencies]
    imgui = "0.0.3"

    配置 backend 或相关 feature

    [dependencies]
    imgui = { version = "0.0.3", features = ["docking"] } # Request a feature of this dependency
    widget = { version = "1.0", backend = "glfw_opengl3" } # Sugar for: features=["backend-glfw_opengl3"]
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2804 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:29 · PVG 12:29 · LAX 21:29 · JFK 00:29
    ♥ Do have faith in what you're doing.