I currently maintain a legacy C+ app that runs on x86/x86_64/armhf linux, all 4 android archs and x86/x86_64 windows.

The linux compilation phase takes 1m, whereas on windows (using MinGW) it takes 10m. It’s not the end of the world, but would the MS compiler be faster? Better?

  • aard@kyu.de
    link
    fedilink
    arrow-up
    23
    ·
    1 year ago

    From the perspective of the CI guy: Just cross compile from Linux.

    You can get the Windows compilers for free - just CLI build tools are enough for your case. The setup can be a bit messy, though. Also, if it’s a GCC only codebase so far there’s a decent chance it has constructs which will not compile on MSVC. It will not necessarily be faster, though.

    • 0x0OP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      if it’s a GCC only codebase so far there’s a decent chance it has constructs which will not compile on MSVC

      Yeah in recent experiments i thing i’ve hit that wall… next experiment: mingw on linux.

  • mkwt@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    MSVC is probably about the same as mingw. Compiling stuff on Windows is slower because compiling creates a lot of short lived processes, and process creation is a lot more expensive on Windows NT.

  • coltorl
    link
    fedilink
    arrow-up
    9
    arrow-down
    1
    ·
    1 year ago

    If you’re supporting windows anyway you should use their tooling. This isn’t controversial, MSVC is a good compiler supported by good developers. I find MSVC more reliable than MinGW on windows as well. I recommend maintaining a single CMake project so that you can switch between compilers and build tools.

  • TootSweet@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    4
    ·
    1 year ago

    Do consider that Microsoft is not your friend and may pull evil legal and pricing tricks that fuck you over down the road. For instance, something like what Unity tried to pull recently.

    Hell will freeze over before GCC or MinGW tries to pull something like that. (And even if they tried, someone could fork GCC or MinGW to ensure a free version remains available.)