roc-toolkit icon indicating copy to clipboard operation
roc-toolkit copied to clipboard

Minimal MinGW build for Windows

Open gavv opened this issue 5 years ago • 1 comments

Last revised: Oct 2023

We have #132 to track efforts related to Windows porting. We've already fixed a few minor issues with SCons on Windows.

This sub-task is the first significant step towards Windows support: make minimal Roc configuration building with MinGW:

scons --host=x86_64-w64-mingw32 --compiler=gcc --disable-lib --disable-tools --disable-doc --disable-openfec --disable-sox --disable-libunwind --disable-pulseaudio

(The exact --host may differ.)

See also Dependencies and SCons options.

To achieve this, we should add a windows platform to SConstruct. As with other platforms, we should auto-detect it from --host. Currently supported platforms are linux, darwin, and android.

The selected platform defines what target directories are enabled.

We can enable the following target directories on Windows / MinGW:

  • target_pc
  • target_c11
  • target_libuv
  • target_nobacktrace
  • target_nodemangle

If some code from these directories will fail to build on MinGW, we will have to fix it.

The following target directories, most likely, can't be enabled:

  • target_posix
  • target_posix_ext
  • target_posix_pc

We will have to create target_windows, enable it on Windows, and fill it with Windows implementations of functions and classes from target_posix and target_posix_ext.

We don't have to implement all of them in this task. Some of them are not needed because they are used only on POSIX systems. Some of them are not needed on minimal build. And some of them are needed, but may be no-op on Windows.

A reasonable approach would be to run compilation, see what's missing, and add corresponding implementations.

We will also have to fix any issues with SCons running on Windows, if they appear.

BTW, MinGW toolchain is available on Linux. If it makes sense, we can start from fixing MinGW build on Linux first, and then try to run it on Windows.

After finishing this task, we should also add minimal MinGW build to CI.

gavv avatar Dec 05 '19 09:12 gavv