[Mesa-dev] [PATCH 00/48] Meson for Windows (mingw and msvc)

Dylan Baker dylan at pnwbakers.com
Mon Jun 11 22:55:27 UTC 2018


This series gets things compiling with MinGW on Linux and MSVC on windows. I've
got things compiling and some unit tests passing (with one still failing, and a
few disabled). This is pretty much a shotgun approach, I just blindly copied all
of the flags from scons/gallium.py and then began wacking problems with a hammer
until they disappeared, first with mingw on Linux as a cross compile, then on
windows with MSVC. I'm going to admit that I don't have a clue as to what I'm
doing on windows, but I've made an attempt.

This is kinda Work-in-progress, but I think it's close enough that the remaining
problems are going to be the kind that someone who actually knows how to develop
for windows is going to have to solve, not the kind that I can solve. There is
likely still some style stuff that can be cleaned up, and there are certainly
patches that need to be re-worked to fit mesa's requirements for clean builds.
I've mainly tested this using ninja, but I did do one test with the VS2017
backend.

Notable for this series is the inclusion of expat and zlib as meson wraps, this
allows both to be built and installed as part of the mesa build process. For
production releases you'll probably want to set those to static so that they
wont be provided as .dlls.

For those wanting to fetch this without applying 48 patches:
git://people.freedesktop.org/~dbaker/mesa meson-windows

contains an up-to-date version of this series.

Dylan Baker (48):
  meson: always define libglapi
  add a git ignore for subprojects
  meson: add a zlib subproject
  meson: add a expat subproject
  gallium: fix ddebug on windows
  glapi: export glapi_destroy_multithread when building shared-glapi on
    windows
  glsl: fix general_ir_test with mingw
  meson: fix dl detection on non cygwin windows
  meson: build getopt when using msvc
  meson: Add a platform for windows
  meson: don't build glx or dri by default on windows
  meson: don't allow glvnd on windows
  meson: add windows compiler checks and libraries
  meson: don't build shader cache on windows
  meson: Add windows defines to glapi
  meson: Add necessary defines for mesa_gallium on windows
  meson: build gallium gdi winsys
  meson: build wgl state tracker
  meson: build libgl-gdi target
  meson: build graw-gdi target
  meson: fix gallium-osmesa to build for windows
  meson: Don't check for posix_memalign on windows
  meson: Add support for wrapping llvm
  docs/meson.html: fix numerous issues spotted by xmllint
  util/xmlconfig: include strndup.h for windows
  meson: fix pipe-loader compilation for windows
  meson: don't look for rt on windows
  meson: Add support for using win_flex and win_bison on windows
  meson: don't look for nm binary on windows
  meson: for incluse of inttypes.h for glcpp with msvc
  meson: disable sse4.1 optimizations with msvc
  meson: add switches for SWR with MSVC
  meson: don't define GLX_USE_TLS for windows
  meson: Add idep_getopt for tests
  util/tests: Use define instead of VLA
  meson: Don't build glsl cache_test for windows
  glsl/tests: define ssize_t on windows
  nir/meson: fix c vs cpp args for nir test
  meson: Set visibility and compat args for graw
  meosn: don't build gallium trivial tests on windows
  meson: Fix gtest linkage on msvc
  meson: disable graw tests on mingw
  meson: don't build or run mesa-sha1 test on windows
  meson: add windows specific linker flags
  meson: allow python2 to be installed as python
  appveyor: Add support for meson as well as scons
  appveyor: use chocolatey (cinst) to isntall winflexbixon
  tests/vma: fix build with MSVC

 appveyor.yml                                  |  34 +-
 docs/meson.html                               |  71 +++-
 meson.build                                   | 386 ++++++++++++------
 meson_options.txt                             |   7 +
 src/compiler/glsl/glcpp/meson.build           |  16 +-
 src/compiler/glsl/meson.build                 |   6 +-
 src/compiler/glsl/tests/blob_test.c           |   4 +
 src/compiler/glsl/tests/general_ir_test.cpp   |  14 +-
 src/compiler/glsl/tests/meson.build           |  23 +-
 src/compiler/nir/meson.build                  |   2 +-
 src/gallium/auxiliary/driver_ddebug/dd_util.h |   6 +-
 src/gallium/auxiliary/meson.build             |   6 +
 src/gallium/auxiliary/pipe-loader/meson.build |   9 +-
 src/gallium/drivers/swr/meson.build           |   3 +-
 .../drivers/swr/rasterizer/jitter/meson.build |  13 +-
 src/gallium/meson.build                       |  14 +-
 src/gallium/state_trackers/osmesa/meson.build |  12 +-
 .../{osmesa => wgl}/meson.build               |  32 +-
 .../{graw-xlib => graw-gdi}/meson.build       |  21 +-
 src/gallium/targets/graw-null/meson.build     |   2 +
 src/gallium/targets/graw-xlib/meson.build     |   1 +
 .../{graw-xlib => libgl-gdi}/meson.build      |  30 +-
 src/gallium/targets/osmesa/meson.build        |   9 +-
 src/gallium/tests/meson.build                 |  11 +-
 .../{tests => winsys/sw/gdi}/meson.build      |  12 +-
 src/{gallium/tests => getopt}/meson.build     |  14 +-
 src/gtest/meson.build                         |   7 +
 src/mapi/es1api/meson.build                   |  12 +-
 src/mapi/es2api/meson.build                   |  12 +-
 src/mapi/glapi/glapi.h                        |   2 +-
 src/mapi/glapi/meson.build                    |  13 +-
 src/mapi/meson.build                          |   2 +
 src/mapi/shared-glapi/meson.build             |   9 +-
 src/mesa/meson.build                          |  12 +-
 src/meson.build                               |   5 +
 src/util/meson.build                          |  21 +-
 src/util/tests/hash_table/clear.c             |  13 +-
 src/util/tests/hash_table/delete_management.c |  13 +-
 src/util/tests/hash_table/insert_many.c       |  11 +-
 src/util/tests/hash_table/meson.build         |   1 +
 src/util/tests/hash_table/random_entry.c      |   7 +-
 src/util/tests/string_buffer/meson.build      |   1 +
 src/util/tests/vma/vma_random_test.cpp        |   8 +
 src/util/xmlconfig.c                          |   1 +
 subprojects/.gitignore                        |   3 +
 subprojects/expat.wrap                        |  10 +
 subprojects/zlib.wrap                         |  10 +
 47 files changed, 688 insertions(+), 243 deletions(-)
 copy src/gallium/state_trackers/{osmesa => wgl}/meson.build (64%)
 copy src/gallium/targets/{graw-xlib => graw-gdi}/meson.build (75%)
 copy src/gallium/targets/{graw-xlib => libgl-gdi}/meson.build (62%)
 copy src/gallium/{tests => winsys/sw/gdi}/meson.build (86%)
 copy src/{gallium/tests => getopt}/meson.build (84%)
 create mode 100644 subprojects/.gitignore
 create mode 100644 subprojects/expat.wrap
 create mode 100644 subprojects/zlib.wrap

-- 
2.17.1



More information about the mesa-dev mailing list