Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Preliminary support of meson builds. #488

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/projects/unix/_obj*/
/projects/unix/libmupen64plus*.so*
/subprojects/packagecache/
/subprojects/libpng-*/
/subprojects/SDL2-*/
/subprojects/zlib-*/
/subprojects/freetype2*/
68 changes: 47 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
sudo: required
dist: trusty
language: cpp
compiler:
- gcc
- clang
language: python
python: 3.6
addons:
apt:
packages:
- python3-pip
- libsdl1.2-dev
- libsdl2-dev
- libfreetype6-dev
Expand All @@ -19,20 +18,43 @@ addons:
- binutils-dev
- nasm
- libopencv-dev

env:
- OSD=0
- OSD=1
- NO_ASM=1
- LIRC=1
- PROFILE=1
- DEBUGGER=1
- DBG_CORE=1
- DBG_COUNT=1
- DBG_COMPARE=1
- COUNT_INSTR=1
- CC=gcc MESON_CONFIGURE="-Dosd=true"
- CC=gcc MESON_CONFIGURE="-Dosd=false"
- CC=gcc MESON_CONFIGURE="-Dno_asm=true"
- CC=gcc MESON_CONFIGURE="-Dlirc=true"
- CC=gcc MESON_CONFIGURE="-Ddebugger=true"
- CC=gcc MESON_CONFIGURE="-Ddbg_compare=true"
- CC=gcc MESON_CONFIGURE="-Ddbg_core=true"
- CC=gcc MESON_CONFIGURE="-Ddbg_count=true"
- CC=gcc MESON_CONFIGURE="-Ddbg_profile=true"
- CC=gcc MESON_CONFIGURE="-Ddbg_timing=true"
- CC=clang MESON_CONFIGURE="-Dosd=true"
- CC=clang MESON_CONFIGURE="-Dosd=false"
- CC=clang MESON_CONFIGURE="-Dno_asm=true"
- CC=clang MESON_CONFIGURE="-Dlirc=true"
- CC=clang MESON_CONFIGURE="-Ddebugger=true"
- CC=clang MESON_CONFIGURE="-Ddbg_compare=true"
- CC=clang MESON_CONFIGURE="-Ddbg_core=true"
- CC=clang MESON_CONFIGURE="-Ddbg_count=true"
- CC=clang MESON_CONFIGURE="-Ddbg_profile=true"
- CC=clang MESON_CONFIGURE="-Ddbg_timing=true"

install:
- python3 --version
- export PATH="`pwd`/build:${PATH}"
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip && unzip -q ninja-linux.zip -d build; fi
- pip3 install meson

script:
- make -C projects/unix V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix V=1 all
- make -C projects/unix V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl2-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix V=1 all
# XXX: disable LTO for now to avoid clang link failure
- meson -Db_lto=false "$MESON_CONFIGURE" builddir
# disable LTO when using clang, because broken Travis packages can't find LLVMgold.so plugin at linkk time...
#- if [[ "${CC%%+*}" == "clang" ]]; then meson configure -Db_lto=false builddir; fi
# Print configuration just to make sure we got it right
- meson configure builddir
- ninja -C builddir

# extra mxe build entries
matrix:
Expand All @@ -56,8 +78,10 @@ matrix:
- mxe-i686-w64-mingw32.shared-pkgconf
- nasm
script:
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix V=1 clean &&
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix V=1 -j$(nproc) all
# XXX: disable LTO for now to avoid subprojects linking failure
- meson -Db_lto=false --cross-file cross/mxe-i686-w64-mingw32-cross.txt builddir
- meson configure builddir
- ninja -C builddir

- env:
- MXE_CPU=x86_64
Expand All @@ -75,8 +99,10 @@ matrix:
- mxe-x86-64-w64-mingw32.shared-libpng
- mxe-x86-64-w64-mingw32.shared-zlib
- mxe-x86-64-w64-mingw32.shared-opencv
- mxe-i686-w64-mingw32.shared-pkgconf
- mxe-x86-64-w64-mingw32.shared-pkgconf
- nasm
script:
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix V=1 clean &&
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix V=1 -j$(nproc) all
# XXX: disable LTO for now to avoid subprojects linking failure
- meson -Db_lto=false --cross-file cross/mxe-x86-64-w64-mingw32-cross.txt builddir
- meson configure builddir
- ninja -C builddir
44 changes: 37 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
version: 1.0.{build}

configuration:
- New_Dynarec_Release
- Release

platform:
- x86
- x64

environment:
matrix:
- compiler: msvc2013
meson_configure: -Dnew_dynarec=true
- compiler: msvc2013
meson_configure: -Dnew_dynarec=false

matrix:
exclude:
- platform: x64
configuration: New_Dynarec_Release
meson_configure: -Dnew_dynarec=true

install:
- cmd: set ORIG_PATH=%PATH%
# XXX Use a Ninja with QuLogic's patch: https://github.com/ninja-build/ninja/issues/1219
# Use the x86 python only when building for x86 for the cpython tests.
# For all other archs (including, say, arm), use the x64 python.
- cmd: if %platform%==x86 (set PYTHON_ROOT=C:\Python36) else (set PYTHON_ROOT=C:\Python36-x64)
- cmd: set MESON_FIXED_NINJA=1
- cmd: echo "PYTHON_ROOT=%PYTHON_ROOT%"
- cmd: curl -fsS -o "%PYTHON_ROOT%\Scripts\ninja.exe" https://nirbheek.in/files/binaries/ninja/win32/ninja.exe
- cmd: if %compiler%==msvc2010 (call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %platform%)
- cmd: if %compiler%==msvc2013 (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %platform%)
- cmd: if %compiler%==msvc2015 (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform%)
- cmd: set PATH=%cd%;%PYTHON_ROOT%;%PYTHON_ROOT%\Scripts;%PATH%
- cmd: echo %PATH%
- cmd: python --version
- cmd: ninja --version
- cmd: pip install meson
- cmd: git clone --depth 1 https://github.com/mupen64plus/mupen64plus-win32-deps.git ../mupen64plus-win32-deps

build_script:
- cmd: echo Building on %platform% with %compiler%
# FIXME: disable OSD and opencv for now, because missing dependencies
- cmd: meson --backend=ninja -Dopencv=false %meson_configure% builddir
- cmd: meson configure builddir
- cmd: ninja -C builddir

before_build:
- cmd: git clone --depth 1 https://github.com/mupen64plus/mupen64plus-win32-deps.git ../mupen64plus-win32-deps
build:
project: projects/VisualStudio2013/mupen64plus-core.vcxproj
verbosity: minimal
on_finish:
- cmd: set PATH=%ORIG_PATH%
15 changes: 15 additions & 0 deletions cross/mxe-i686-w64-mingw32-cross.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[binaries]
c = '/usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-gcc'
cpp = '/usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-g++'
ar = '/usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-ar'
pkgconfig = '/usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-pkg-config'
strip = '/usr/lib/mxe/usr/bin/i686-w64-mingw32.shared-strip'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
15 changes: 15 additions & 0 deletions cross/mxe-x86-64-w64-mingw32-cross.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[binaries]
c = '/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-gcc'
cpp = '/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-g++'
ar = '/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-ar'
pkgconfig = '/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-pkg-config'
strip = '/usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-strip'

[properties]
needs_exe_wrapper = true

[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'