Skip to content

Commit

Permalink
subprojects: fix libplacebo build on freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
llyyr committed Sep 26, 2023
1 parent c428738 commit 5768354
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/subprojects/*
!/subprojects/libplacebo.wrap
!/subprojects/packagefiles/
!/subprojects/*.wrap
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project('mpv',
'c',
license: ['GPL2+', 'LGPL2.1+'],
version: files('./VERSION'),
meson_version: '>=0.62.0',
meson_version: '>=0.63.0',
default_options: [
'buildtype=debugoptimized',
'b_lundef=false',
Expand Down
1 change: 1 addition & 0 deletions subprojects/libplacebo.wrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ url = https://code.videolan.org/videolan/libplacebo.git
revision = v6.338.0
depth = 1
clone-recursive = true
diff_files = fix-freebsd.diff
29 changes: 29 additions & 0 deletions subprojects/packagefiles/fix-freebsd.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/meson.build b/meson.build
index e339cf33..bc3fe0e7 100644
--- a/meson.build
+++ b/meson.build
@@ -384,11 +384,12 @@ build_opts = [

link_args = []

+host_system = host_machine.system()
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')

c_opts = [
- '-D_ISOC99_SOURCE', '-D_ISOC11_SOURCE', '-D_GNU_SOURCE', '-D_XOPEN_SOURCE=700',
+ '-D_ISOC99_SOURCE', '-D_ISOC11_SOURCE', '-D_GNU_SOURCE',
'-U__STRICT_ANSI__', '-Wmissing-prototypes',

# Warnings to ignore
@@ -399,6 +400,10 @@ c_opts = [
'-Werror=implicit-function-declaration',
]

+if host_system != 'freebsd'
+ c_opts += ['-D_XOPEN_SOURCE=700']
+endif
+
if cc.has_argument('-Wincompatible-pointer-types')
c_opts += ['-Werror=incompatible-pointer-types']
endif

0 comments on commit 5768354

Please sign in to comment.