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

meson: try some system libs first #1866

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ jobs:
export CCACHE_DIR=${GITHUB_WORKSPACE}/xemu-ccache
export CCACHE_MAXSIZE=512M
export PATH="/usr/local/opt/ccache/libexec:$PATH"
export PKG_CONFIG_DIR=""
export PKG_CONFIG_LIBDIR="/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig"
ccache -z
./build.sh ${{ matrix.build_param }}
echo -e "\nCompiler Cache Stats:"
Expand Down
7 changes: 3 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,7 @@ if host_os == 'windows'
])
elif host_os == 'linux'
vulkan = dependency('vulkan')
libglslang = dependency('glslang', required: false)
endif

if vulkan.found()
Expand Down Expand Up @@ -3533,11 +3534,9 @@ if have_libvduse
libvduse = libvduse_proj.get_variable('libvduse_dep')
endif

tomlplusplus_proj = subproject('tomlplusplus', default_options: ['default_library=static'])
tomlplusplus = tomlplusplus_proj.get_variable('tomlplusplus_dep')
tomlplusplus = dependency('tomlplusplus', fallback: ['tomlplusplus', 'tomlplusplus_dep'], default_options: ['default_library=static'])

xxhash_proj = subproject('xxhash', default_options: ['default_library=static'])
xxhash = xxhash_proj.get_variable('xxhash_dep')
xxhash = dependency('libxxhash', fallback: ['xxhash', 'xxhash_dep'], default_options: ['default_library=static'])

#####################
# Generated sources #
Expand Down
1 change: 1 addition & 0 deletions subprojects/SPIRV-Reflect.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
url=https://github.com/KhronosGroup/SPIRV-Reflect
revision=vulkan-sdk-1.3.296.0
depth=1
method=cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Is this necessary? Since meson.build already uses the CMake module to handle this wrap, I'm not sure why this change is required.
  • method looks to be introduced with Meson v1.3.0, but meson.build requires meson_version: '>=1.1.0'. If it really is required, then we need to bump the minimum Meson version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meson subprojects download exits with an error code when cmake subprojects exists:

$ meson subprojects download
(...)
Download nv2a_vsh_cpu...
  -> Subproject exists but has no meson.build file.
(...)
Download SPIRV-Reflect...
  -> Subproject exists but has no meson.build file.
(...)
WARNING: Please check logs above as command failed in some subprojects which could have been left in conflict state: SPIRV-Reflect, VulkanMemoryAllocator, glslang, nv2a_vsh_cpu, volk
$ echo $?
5

1 change: 1 addition & 0 deletions subprojects/VulkanMemoryAllocator.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
revision=v3.2.0
depth=1
method=cmake
1 change: 1 addition & 0 deletions subprojects/glslang.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
url=https://github.com/KhronosGroup/glslang
revision=vulkan-sdk-1.3.296.0
depth=1
method=cmake
1 change: 1 addition & 0 deletions subprojects/nv2a_vsh_cpu.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
url=https://github.com/xemu-project/nv2a_vsh_cpu
revision=561fe80da57a881f89000256b459440c0178a7ce
depth=1
method=cmake
1 change: 1 addition & 0 deletions subprojects/volk.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
url=https://github.com/zeux/volk
revision=1.3.295
depth=1
method=cmake
File renamed without changes.
20 changes: 13 additions & 7 deletions ui/thirdparty/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ endif
libfpng = static_library('fpng', sources: 'fpng/fpng.cpp', cpp_args: libfpng_cpp_args)
fpng = declare_dependency(include_directories: 'fpng', link_with: libfpng)

json = declare_dependency(include_directories: 'json')
json = dependency('nlohmann_json', required: false)
if not json.found()
json = declare_dependency(include_directories: 'json')
endif

httplib_proj = subproject('cpp-httplib', default_options: ['cpp-httplib_openssl=enabled'])
httplib_deps = [httplib_proj.get_variable('cpp_httplib_dep')]
if host_os == 'windows'
httplib_deps += [crypt32]
httplib = dependency('httplib', components: ['OpenSSL'], method: 'cmake', required: false)
if not httplib.found()
httplib_proj = subproject('cpp-httplib', default_options: ['cpp-httplib_openssl=enabled'])
httplib_deps = [httplib_proj.get_variable('cpp_httplib_dep')]
if host_os == 'windows'
httplib_deps += [crypt32]
endif
httplib = declare_dependency(dependencies: httplib_deps)
endif
httplib = declare_dependency(dependencies: httplib_deps)

libfatx = static_library('fatx', sources: 'fatx/fatx.c')
libfatx = static_library('fatx', sources: files('fatx/fatx.c') + genh)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does libfatx now depend on genh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because otherwise you get this error:

[13/1482] Linking static target thirdparty/libvma.a
samu: job failed: cc -Iui/thirdparty/libfatx.a.p -Iui/thirdparty -I../xemu/ui/thirdparty -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi -Wno-shift-negative-value -isystem /build/xemu-git/src/xemu/linux-headers -isystem linux-headers -iquote . -iquote /build/xemu-git/src/xemu -iquote /build/xemu-git/src/xemu/include -iquote /build/xemu-git/src/xemu/host/include/x86_64 -iquote /build/xemu-git/src/xemu/host/include/generic -iquote /build/xemu-git/src/xemu/tcg/i386 -pthread -mcx16 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -flto=auto -DXBOX=1 -fPIE -MD -MQ ui/thirdparty/libfatx.a.p/fatx_fatx.c.o -MF ui/thirdparty/libfatx.a.p/fatx_fatx.c.o.d -o ui/thirdparty/libfatx.a.p/fatx_fatx.c.o -c ../xemu/ui/thirdparty/fatx/fatx.c
In file included from /build/xemu-git/src/xemu/include/qemu/osdep.h:38,
                 from ../xemu/ui/thirdparty/fatx/fatx.h:4,
                 from ../xemu/ui/thirdparty/fatx/fatx.c:1:
/build/xemu-git/src/xemu/include/exec/poison.h:7:10: fatal error: config-poison.h: No such file or directory
    7 | #include "config-poison.h"
      |          ^~~~~~~~~~~~~~~~~

fatx = declare_dependency(include_directories: 'fatx', link_with: libfatx)
2 changes: 1 addition & 1 deletion ui/xui/reporting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <stdio.h>
#include "reporting.hh"
#include <httplib.h>
#include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;

#define DEBUG_COMPAT_SERVICE 0
Expand Down
Loading