wscript: look for system provided vorbis and opus dependencies
In some configuration, like Flatpak, on dev machines or when packaging for *nix we can safely link with system libraries.
This commit is contained in:
parent
3661af921e
commit
c39d2e243a
2 changed files with 12 additions and 5 deletions
|
@ -141,7 +141,7 @@ def build(bld):
|
||||||
bld(name = 'engine_includes', export_includes = '. common common/imagelib', use = 'filesystem_includes')
|
bld(name = 'engine_includes', export_includes = '. common common/imagelib', use = 'filesystem_includes')
|
||||||
|
|
||||||
is_cxx_link = False
|
is_cxx_link = False
|
||||||
libs = [ 'engine_includes', 'public', 'dllemu', 'werror', 'opus', 'libvorbisfile', 'libopusfile' ]
|
libs = [ 'engine_includes', 'public', 'dllemu', 'werror', 'opus', 'libvorbis', 'libvorbisfile', 'libopusfile' ]
|
||||||
|
|
||||||
# basic build: dedicated only
|
# basic build: dedicated only
|
||||||
source = bld.path.ant_glob([
|
source = bld.path.ant_glob([
|
||||||
|
|
13
wscript
13
wscript
|
@ -84,9 +84,6 @@ SUBDIRS = [
|
||||||
Subproject('filesystem'),
|
Subproject('filesystem'),
|
||||||
Subproject('stub/server'),
|
Subproject('stub/server'),
|
||||||
Subproject('dllemu'),
|
Subproject('dllemu'),
|
||||||
Subproject('3rdparty/libogg'),
|
|
||||||
Subproject('3rdparty/vorbis'),
|
|
||||||
Subproject('3rdparty/opusfile'),
|
|
||||||
|
|
||||||
# disable only by engine feature, makes no sense to even parse subprojects in dedicated mode
|
# disable only by engine feature, makes no sense to even parse subprojects in dedicated mode
|
||||||
Subproject('3rdparty/extras', lambda x: not x.env.DEDICATED and x.env.DEST_OS != 'android'),
|
Subproject('3rdparty/extras', lambda x: not x.env.DEDICATED and x.env.DEST_OS != 'android'),
|
||||||
|
@ -107,6 +104,9 @@ SUBDIRS = [
|
||||||
|
|
||||||
# disable only by external dependency presense
|
# disable only by external dependency presense
|
||||||
Subproject('3rdparty/opus', lambda x: not x.env.HAVE_SYSTEM_OPUS),
|
Subproject('3rdparty/opus', lambda x: not x.env.HAVE_SYSTEM_OPUS),
|
||||||
|
Subproject('3rdparty/libogg', lambda x: not x.env.HAVE_SYSTEM_OGG),
|
||||||
|
Subproject('3rdparty/vorbis', lambda x: not x.env.HAVE_SYSTEM_VORBIS and not x.env.HAVE_SYSTEM_VORBISFILE),
|
||||||
|
Subproject('3rdparty/opusfile', lambda x: not x.env.HAVE_SYSTEM_OPUSFILE),
|
||||||
|
|
||||||
# enabled optionally
|
# enabled optionally
|
||||||
Subproject('utils/mdldec', lambda x: x.env.ENABLE_UTILS),
|
Subproject('utils/mdldec', lambda x: x.env.ENABLE_UTILS),
|
||||||
|
@ -473,6 +473,13 @@ def configure(conf):
|
||||||
conf.env.SHAREDIR = conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
|
conf.env.SHAREDIR = conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
|
||||||
|
|
||||||
if not conf.options.BUILD_BUNDLED_DEPS:
|
if not conf.options.BUILD_BUNDLED_DEPS:
|
||||||
|
for i in (('ogg', 'libogg'),
|
||||||
|
('opusfile', 'libopusfile'),
|
||||||
|
('vorbis', 'libvorbis'),
|
||||||
|
('vorbisfile', 'libvorbisfile')):
|
||||||
|
if conf.check_cfg(package=i[0], uselib_store=i[1], args='--cflags --libs', mandatory=False):
|
||||||
|
conf.env['HAVE_SYSTEM_%s' % i[0].upper()] = True
|
||||||
|
|
||||||
# search for opus 1.4 or higher, it has fixes for custom modes
|
# search for opus 1.4 or higher, it has fixes for custom modes
|
||||||
if conf.check_cfg(package='opus', uselib_store='opus', args='opus >= 1.4 --cflags --libs', mandatory=False):
|
if conf.check_cfg(package='opus', uselib_store='opus', args='opus >= 1.4 --cflags --libs', mandatory=False):
|
||||||
# now try to link with export that only exists with CUSTOM_MODES defined
|
# now try to link with export that only exists with CUSTOM_MODES defined
|
||||||
|
|
Loading…
Add table
Reference in a new issue