mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 03:52:55 +02:00
Only use pkg-config in macOS builds
This commit is contained in:
parent
70959f5368
commit
42cccfd03d
3 changed files with 16 additions and 7 deletions
6
.github/workflows/autobuild.yml
vendored
6
.github/workflows/autobuild.yml
vendored
|
@ -352,7 +352,7 @@ jobs:
|
||||||
- uses: msys2/setup-msys2@v2
|
- uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: mingw64
|
msystem: mingw64
|
||||||
install: base-devel git mingw-w64-x86_64-pkgconf mingw-w64-x86_64-cmake mingw-w64-x86_64-meson mingw-w64-x86_64-autotools mingw-w64-x86_64-gcc mingw-w64-x86_64-zlib
|
install: base-devel git mingw-w64-x86_64-cmake mingw-w64-x86_64-meson mingw-w64-x86_64-autotools mingw-w64-x86_64-gcc mingw-w64-x86_64-zlib
|
||||||
|
|
||||||
- name: Build phase 2
|
- name: Build phase 2
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
|
@ -429,7 +429,7 @@ jobs:
|
||||||
echo 'Components: main universe' | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
|
echo 'Components: main universe' | sudo tee -a /etc/apt/sources.list.d/ubuntu.sources
|
||||||
fi
|
fi
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install git curl build-essential pkgconf automake libtool meson cmake -y
|
sudo apt install git curl build-essential automake libtool meson cmake -y
|
||||||
if [ '${{ matrix.arch_mkxpz }}' != 'x86_64' ]
|
if [ '${{ matrix.arch_mkxpz }}' != 'x86_64' ]
|
||||||
then
|
then
|
||||||
sudo apt install gcc-${{ matrix.arch_gcc }} g++-${{ matrix.arch_gcc }} zlib1g-dev:${{ matrix.arch_debian }} -y
|
sudo apt install gcc-${{ matrix.arch_gcc }} g++-${{ matrix.arch_gcc }} zlib1g-dev:${{ matrix.arch_debian }} -y
|
||||||
|
@ -486,7 +486,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir ${{ runner.temp }}/retro-phase2
|
mkdir ${{ runner.temp }}/retro-phase2
|
||||||
cp retro/core.info ${{ runner.temp }}/retro-phase2/libretro-mkxp-z.info
|
cp retro/core.info ${{ runner.temp }}/retro-phase2/libretro-mkxp-z.info
|
||||||
PKG_CONFIG_PATH=${{ runner.temp }}/deps/share/pkgconfig meson setup build -Dretro=true -Dretro_phase1_path=retro/build/retro-phase1
|
PKG_CONFIG_PATH=${{ runner.temp }}/deps/share/pkgconfig meson setup build -Dretro=true -Dretro_phase1_path=retro/build/retro-phase1 -Dretro_lookup_method=pkg-config
|
||||||
cd build
|
cd build
|
||||||
ninja
|
ninja
|
||||||
mv libretro-mkxp-z.dylib ${{ runner.temp }}/retro-phase2
|
mv libretro-mkxp-z.dylib ${{ runner.temp }}/retro-phase2
|
||||||
|
|
16
meson.build
16
meson.build
|
@ -31,7 +31,9 @@ global_args += '-DHAVE_NANOSLEEP'
|
||||||
|
|
||||||
if get_option('retro') == true
|
if get_option('retro') == true
|
||||||
retro_phase1 = get_option('retro_phase1_path')
|
retro_phase1 = get_option('retro_phase1_path')
|
||||||
|
|
||||||
cmake = import('cmake')
|
cmake = import('cmake')
|
||||||
|
|
||||||
libzip_options = cmake.subproject_options()
|
libzip_options = cmake.subproject_options()
|
||||||
libzip_options.add_cmake_defines({
|
libzip_options.add_cmake_defines({
|
||||||
'CMAKE_POSITION_INDEPENDENT_CODE': true,
|
'CMAKE_POSITION_INDEPENDENT_CODE': true,
|
||||||
|
@ -47,12 +49,18 @@ if get_option('retro') == true
|
||||||
'ENABLE_LZMA': false,
|
'ENABLE_LZMA': false,
|
||||||
'ENABLE_ZSTD': false,
|
'ENABLE_ZSTD': false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
retro_deps = []
|
||||||
|
if get_option('retro_lookup_method') == 'pkg-config'
|
||||||
|
retro_deps += dependency('zlib', static: true)
|
||||||
|
else
|
||||||
|
retro_deps += compilers['cpp'].find_library('z', required: true, static: true)
|
||||||
|
endif
|
||||||
|
retro_deps += cmake.subproject('libzip', options: libzip_options).dependency('zip')
|
||||||
|
|
||||||
library(
|
library(
|
||||||
'retro-' + meson.project_name(),
|
'retro-' + meson.project_name(),
|
||||||
dependencies: [
|
dependencies: retro_deps,
|
||||||
dependency('zlib', static: true),
|
|
||||||
cmake.subproject('libzip', options: libzip_options).dependency('zip'),
|
|
||||||
],
|
|
||||||
c_args: [
|
c_args: [
|
||||||
'-fno-optimize-sibling-calls',
|
'-fno-optimize-sibling-calls',
|
||||||
'-frounding-math',
|
'-frounding-math',
|
||||||
|
|
|
@ -24,3 +24,4 @@ option('gfx_backend', type: 'combo', value: 'gl', choices: ['gl', 'gles'], descr
|
||||||
|
|
||||||
option('retro', type: 'boolean', value: false, description: 'Build a libretro core instead of an executable')
|
option('retro', type: 'boolean', value: false, description: 'Build a libretro core instead of an executable')
|
||||||
option('retro_phase1_path', type: 'string', value: '', description: 'Path to retro-phase1 for libretro builds')
|
option('retro_phase1_path', type: 'string', value: '', description: 'Path to retro-phase1 for libretro builds')
|
||||||
|
option('retro_lookup_method', type: 'combo', value: 'compiler', choices: ['compiler', 'pkg-config'], description: 'Method to use to locate software libraries for libretro builds')
|
||||||
|
|
Loading…
Add table
Reference in a new issue