Skip to content

[Question] How do you recommend switching compiler backends for cross-platform builds #32

@BlueFalconHD

Description

@BlueFalconHD

I am building a C program on macOS and I'd like to cross-compile it for Windows. I'd use clang (which works well for macOS and Linux builds) and mingw (x86_64-w64-mingw32-gcc) for Windows builds. However mate.h hardcodes the names for these commands as seen below:

String CompilerToStr(Compiler c) {
  switch (c) {
  case GCC:   return S("gcc");
  case CLANG: return S("clang");
  case TCC:   return S("tcc");
  case MSVC:  return S("cl.exe");
  }
}

So I am stuck symlinking gcc to x86_64-w64-mingw32-gcc and adding that to path if I want to compile for Windows. Is there a better way I am missing?

Additionally, because of my requirements I almost need Mate's rebuilding functionality and the executable's building functionality to have completely separate compiler configurations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions