Use BoolVariable for third-party options.
This commit is contained in:
parent
ffab67b8da
commit
45a9a680a3
30
SConstruct
30
SConstruct
|
@ -157,21 +157,21 @@ opts.Add(BoolVariable('progress', "Show a progress indicator during build", True
|
||||||
opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False))
|
opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=all", False))
|
||||||
|
|
||||||
# Thirdparty libraries
|
# Thirdparty libraries
|
||||||
opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_enet', "Use the builtin enet library", True))
|
||||||
opts.Add('builtin_freetype', "Use the builtin freetype library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_freetype', "Use the builtin freetype library", True))
|
||||||
opts.Add('builtin_libogg', "Use the builtin libogg library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libogg', "Use the builtin libogg library", True))
|
||||||
opts.Add('builtin_libpng', "Use the builtin libpng library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libpng', "Use the builtin libpng library", True))
|
||||||
opts.Add('builtin_libtheora', "Use the builtin libtheora library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libtheora', "Use the builtin libtheora library", True))
|
||||||
opts.Add('builtin_libvorbis', "Use the builtin libvorbis library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libvorbis', "Use the builtin libvorbis library", True))
|
||||||
opts.Add('builtin_libvpx', "Use the builtin libvpx library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libvpx', "Use the builtin libvpx library", True))
|
||||||
opts.Add('builtin_libwebp', "Use the builtin libwebp library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_libwebp', "Use the builtin libwebp library", True))
|
||||||
opts.Add('builtin_openssl', "Use the builtin openssl library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_openssl', "Use the builtin openssl library", True))
|
||||||
opts.Add('builtin_opus', "Use the builtin opus library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_opus', "Use the builtin opus library", True))
|
||||||
opts.Add('builtin_pcre2', "Use the builtin pcre2 library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_pcre2', "Use the builtin pcre2 library)", True))
|
||||||
opts.Add('builtin_recast', "Use the builtin recast library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_recast', "Use the builtin recast library", True))
|
||||||
opts.Add('builtin_squish', "Use the builtin squish library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_squish', "Use the builtin squish library", True))
|
||||||
opts.Add('builtin_zlib', "Use the builtin zlib library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_zlib', "Use the builtin zlib library", True))
|
||||||
opts.Add('builtin_zstd', "Use the builtin zstd library (yes/no)", 'yes')
|
opts.Add(BoolVariable('builtin_zstd', "Use the builtin zstd library", True))
|
||||||
|
|
||||||
# Environment setup
|
# Environment setup
|
||||||
opts.Add("CXX", "C++ compiler")
|
opts.Add("CXX", "C++ compiler")
|
||||||
|
|
|
@ -83,7 +83,7 @@ thirdparty_minizip_sources = [
|
||||||
thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
|
thirdparty_minizip_sources = [thirdparty_minizip_dir + file for file in thirdparty_minizip_sources]
|
||||||
env.add_source_files(env.core_sources, thirdparty_minizip_sources)
|
env.add_source_files(env.core_sources, thirdparty_minizip_sources)
|
||||||
|
|
||||||
if "builtin_zstd" in env and env["builtin_zstd"] == "yes":
|
if 'builtin_zstd' in env and env['builtin_zstd']:
|
||||||
SConscript("#thirdparty/zstd/SCsub")
|
SConscript("#thirdparty/zstd/SCsub")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ Import('env')
|
||||||
|
|
||||||
env.drivers_sources = []
|
env.drivers_sources = []
|
||||||
|
|
||||||
if ("builtin_zlib" in env and env["builtin_zlib"] == "yes"):
|
if 'builtin_zlib' in env and env['builtin_zlib']:
|
||||||
SConscript("zlib/SCsub")
|
SConscript("zlib/SCsub")
|
||||||
|
|
||||||
# OS drivers
|
# OS drivers
|
||||||
|
|
|
@ -5,7 +5,7 @@ Import('env')
|
||||||
env_png = env.Clone()
|
env_png = env.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_libpng'] != 'no'):
|
if env['builtin_libpng']:
|
||||||
thirdparty_dir = "#thirdparty/libpng/"
|
thirdparty_dir = "#thirdparty/libpng/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"png.c",
|
"png.c",
|
||||||
|
|
|
@ -7,7 +7,7 @@ Import('env_modules')
|
||||||
|
|
||||||
env_enet = env_modules.Clone()
|
env_enet = env_modules.Clone()
|
||||||
|
|
||||||
if (env['builtin_enet'] != 'no'):
|
if env['builtin_enet']:
|
||||||
thirdparty_dir = "#thirdparty/enet/"
|
thirdparty_dir = "#thirdparty/enet/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"godot.cpp",
|
"godot.cpp",
|
||||||
|
|
|
@ -6,7 +6,7 @@ from compat import isbasestring
|
||||||
# Not building in a separate env as scene needs it
|
# Not building in a separate env as scene needs it
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_freetype'] != 'no'):
|
if env['builtin_freetype']:
|
||||||
thirdparty_dir = "#thirdparty/freetype/"
|
thirdparty_dir = "#thirdparty/freetype/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"src/autofit/autofit.c",
|
"src/autofit/autofit.c",
|
||||||
|
@ -65,7 +65,7 @@ if (env['builtin_freetype'] != 'no'):
|
||||||
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"])
|
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"])
|
||||||
|
|
||||||
# also requires libpng headers
|
# also requires libpng headers
|
||||||
if (env['builtin_libpng'] != 'no'):
|
if env['builtin_libpng']:
|
||||||
env.Append(CPPPATH=["#thirdparty/libpng"])
|
env.Append(CPPPATH=["#thirdparty/libpng"])
|
||||||
|
|
||||||
lib = env.Library("freetype_builtin", thirdparty_sources)
|
lib = env.Library("freetype_builtin", thirdparty_sources)
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_ogg = env_modules.Clone()
|
env_ogg = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_libogg'] != 'no'):
|
if env['builtin_libogg']:
|
||||||
thirdparty_dir = "#thirdparty/libogg/"
|
thirdparty_dir = "#thirdparty/libogg/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"bitwise.c",
|
"bitwise.c",
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_openssl = env_modules.Clone()
|
env_openssl = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_openssl'] != 'no'):
|
if env['builtin_openssl']:
|
||||||
thirdparty_dir = "#thirdparty/openssl/"
|
thirdparty_dir = "#thirdparty/openssl/"
|
||||||
|
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_opus = env_modules.Clone()
|
env_opus = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_opus'] != 'no'):
|
if env['builtin_opus']:
|
||||||
thirdparty_dir = "#thirdparty/opus/"
|
thirdparty_dir = "#thirdparty/opus/"
|
||||||
|
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
|
@ -209,7 +209,7 @@ if (env['builtin_opus'] != 'no'):
|
||||||
env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])
|
env_opus.Append(CPPPATH=[thirdparty_dir + "/" + dir for dir in thirdparty_include_paths])
|
||||||
|
|
||||||
# also requires libogg
|
# also requires libogg
|
||||||
if (env['builtin_libogg'] != 'no'):
|
if env['builtin_libogg']:
|
||||||
env_opus.Append(CPPPATH=["#thirdparty/libogg"])
|
env_opus.Append(CPPPATH=["#thirdparty/libogg"])
|
||||||
|
|
||||||
# Module files
|
# Module files
|
||||||
|
|
|
@ -5,7 +5,7 @@ Import('env')
|
||||||
# Not building in a separate env as core needs it
|
# Not building in a separate env as core needs it
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_recast'] != 'no'):
|
if env['builtin_recast']:
|
||||||
thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
|
thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"Source/Recast.cpp",
|
"Source/Recast.cpp",
|
||||||
|
@ -24,10 +24,6 @@ if (env['builtin_recast'] != 'no'):
|
||||||
|
|
||||||
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"])
|
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/Include"])
|
||||||
|
|
||||||
# also requires recast headers
|
|
||||||
if (env['builtin_recast'] != 'no'):
|
|
||||||
env.Append(CPPPATH=["#thirdparty/recastnavigation/Recast"])
|
|
||||||
|
|
||||||
lib = env.Library("recast_builtin", thirdparty_sources)
|
lib = env.Library("recast_builtin", thirdparty_sources)
|
||||||
env.Append(LIBS=[lib])
|
env.Append(LIBS=[lib])
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ env_regex = env_modules.Clone()
|
||||||
env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
|
env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
|
||||||
env_regex.add_source_files(env.modules_sources, "*.cpp")
|
env_regex.add_source_files(env.modules_sources, "*.cpp")
|
||||||
|
|
||||||
if (env['builtin_pcre2'] != 'no'):
|
if env['builtin_pcre2']:
|
||||||
jit_blacklist = ['javascript']
|
jit_blacklist = ['javascript']
|
||||||
thirdparty_dir = '#thirdparty/pcre2/src/'
|
thirdparty_dir = '#thirdparty/pcre2/src/'
|
||||||
thirdparty_flags = ['-DPCRE2_STATIC', '-DHAVE_CONFIG_H']
|
thirdparty_flags = ['-DPCRE2_STATIC', '-DHAVE_CONFIG_H']
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_squish = env_modules.Clone()
|
env_squish = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_squish'] != 'no'):
|
if env['builtin_squish']:
|
||||||
thirdparty_dir = "#thirdparty/squish/"
|
thirdparty_dir = "#thirdparty/squish/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"alpha.cpp",
|
"alpha.cpp",
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_theora = env_modules.Clone()
|
env_theora = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_libtheora'] != 'no'):
|
if env['builtin_libtheora']:
|
||||||
thirdparty_dir = "#thirdparty/libtheora/"
|
thirdparty_dir = "#thirdparty/libtheora/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
#"analyze.c",
|
#"analyze.c",
|
||||||
|
@ -74,9 +74,9 @@ if (env['builtin_libtheora'] != 'no'):
|
||||||
env_theora.Append(CPPPATH=[thirdparty_dir])
|
env_theora.Append(CPPPATH=[thirdparty_dir])
|
||||||
|
|
||||||
# also requires libogg and libvorbis
|
# also requires libogg and libvorbis
|
||||||
if (env['builtin_libogg'] != 'no'):
|
if env['builtin_libogg']:
|
||||||
env_theora.Append(CPPPATH=["#thirdparty/libogg"])
|
env_theora.Append(CPPPATH=["#thirdparty/libogg"])
|
||||||
if (env['builtin_libvorbis'] != 'no'):
|
if env['builtin_libvorbis']:
|
||||||
env_theora.Append(CPPPATH=["#thirdparty/libvorbis"])
|
env_theora.Append(CPPPATH=["#thirdparty/libvorbis"])
|
||||||
|
|
||||||
# Godot source files
|
# Godot source files
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_vorbis = env_modules.Clone()
|
env_vorbis = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_libvorbis'] != 'no'):
|
if env['builtin_libvorbis']:
|
||||||
thirdparty_dir = "#thirdparty/libvorbis/"
|
thirdparty_dir = "#thirdparty/libvorbis/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
#"analysis.c",
|
#"analysis.c",
|
||||||
|
@ -42,7 +42,7 @@ if (env['builtin_libvorbis'] != 'no'):
|
||||||
env_vorbis.Append(CPPPATH=[thirdparty_dir])
|
env_vorbis.Append(CPPPATH=[thirdparty_dir])
|
||||||
|
|
||||||
# also requires libogg
|
# also requires libogg
|
||||||
if (env['builtin_libogg'] != 'no'):
|
if env['builtin_libogg']:
|
||||||
env_vorbis.Append(CPPPATH=["#thirdparty/libogg"])
|
env_vorbis.Append(CPPPATH=["#thirdparty/libogg"])
|
||||||
|
|
||||||
# Godot source files
|
# Godot source files
|
||||||
|
|
|
@ -19,14 +19,14 @@ env_webm.add_source_files(env.modules_sources, thirdparty_libsimplewebm_sources)
|
||||||
env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"])
|
env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"])
|
||||||
|
|
||||||
# also requires libogg, libvorbis and libopus
|
# also requires libogg, libvorbis and libopus
|
||||||
if (env['builtin_libogg'] != 'no'):
|
if env['builtin_libogg']:
|
||||||
env_webm.Append(CPPPATH=["#thirdparty/libogg"])
|
env_webm.Append(CPPPATH=["#thirdparty/libogg"])
|
||||||
if (env['builtin_libvorbis'] != 'no'):
|
if env['builtin_libvorbis']:
|
||||||
env_webm.Append(CPPPATH=["#thirdparty/libvorbis"])
|
env_webm.Append(CPPPATH=["#thirdparty/libvorbis"])
|
||||||
if (env['builtin_opus'] != 'no'):
|
if env['builtin_opus']:
|
||||||
env_webm.Append(CPPPATH=["#thirdparty/opus"])
|
env_webm.Append(CPPPATH=["#thirdparty/opus"])
|
||||||
|
|
||||||
if (env['builtin_libvpx'] != 'no'):
|
if env['builtin_libvpx']:
|
||||||
Export('env_webm')
|
Export('env_webm')
|
||||||
SConscript("libvpx/SCsub")
|
SConscript("libvpx/SCsub")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Import('env_modules')
|
||||||
env_webp = env_modules.Clone()
|
env_webp = env_modules.Clone()
|
||||||
|
|
||||||
# Thirdparty source files
|
# Thirdparty source files
|
||||||
if (env['builtin_libwebp'] != 'no'):
|
if env['builtin_libwebp']:
|
||||||
thirdparty_dir = "#thirdparty/libwebp/"
|
thirdparty_dir = "#thirdparty/libwebp/"
|
||||||
thirdparty_sources = [
|
thirdparty_sources = [
|
||||||
"dec/alpha_dec.c",
|
"dec/alpha_dec.c",
|
||||||
|
|
|
@ -97,7 +97,7 @@ def configure(env):
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
if (env['builtin_libtheora'] != 'no'):
|
if env['builtin_libtheora']:
|
||||||
env["x86_libtheora_opt_gcc"] = True
|
env["x86_libtheora_opt_gcc"] = True
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
|
|
@ -64,60 +64,60 @@ def configure(env):
|
||||||
|
|
||||||
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
|
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
|
||||||
|
|
||||||
if (env['builtin_openssl'] == 'no'):
|
if not env['builtin_openssl']:
|
||||||
env.ParseConfig('pkg-config openssl --cflags --libs')
|
env.ParseConfig('pkg-config openssl --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libwebp'] == 'no'):
|
if not env['builtin_libwebp']:
|
||||||
env.ParseConfig('pkg-config libwebp --cflags --libs')
|
env.ParseConfig('pkg-config libwebp --cflags --libs')
|
||||||
|
|
||||||
# freetype depends on libpng and zlib, so bundling one of them while keeping others
|
# freetype depends on libpng and zlib, so bundling one of them while keeping others
|
||||||
# as shared libraries leads to weird issues
|
# as shared libraries leads to weird issues
|
||||||
if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'):
|
if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']:
|
||||||
env['builtin_freetype'] = 'yes'
|
env['builtin_freetype'] = True
|
||||||
env['builtin_libpng'] = 'yes'
|
env['builtin_libpng'] = True
|
||||||
env['builtin_zlib'] = 'yes'
|
env['builtin_zlib'] = True
|
||||||
|
|
||||||
if (env['builtin_freetype'] == 'no'):
|
if not env['builtin_freetype']:
|
||||||
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libpng'] == 'no'):
|
if not env['builtin_libpng']:
|
||||||
env.ParseConfig('pkg-config libpng --cflags --libs')
|
env.ParseConfig('pkg-config libpng --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_enet'] == 'no'):
|
if not env['builtin_enet']:
|
||||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||||
|
|
||||||
if env['builtin_squish'] == 'no' and env['tools']:
|
if not env['builtin_squish'] and env['tools']:
|
||||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||||
|
|
||||||
if env['builtin_zstd'] == 'no':
|
if not env['builtin_zstd']:
|
||||||
env.ParseConfig('pkg-config libzstd --cflags --libs')
|
env.ParseConfig('pkg-config libzstd --cflags --libs')
|
||||||
|
|
||||||
# Sound and video libraries
|
# Sound and video libraries
|
||||||
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
|
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
|
||||||
|
|
||||||
if (env['builtin_libtheora'] == 'no'):
|
if not env['builtin_libtheora']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system libtheora
|
env['builtin_libogg'] = False # Needed to link against system libtheora
|
||||||
env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora
|
env['builtin_libvorbis'] = False # Needed to link against system libtheora
|
||||||
env.ParseConfig('pkg-config theora theoradec --cflags --libs')
|
env.ParseConfig('pkg-config theora theoradec --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libvpx'] == 'no'):
|
if not env['builtin_libvpx']:
|
||||||
env.ParseConfig('pkg-config vpx --cflags --libs')
|
env.ParseConfig('pkg-config vpx --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libvorbis'] == 'no'):
|
if not env['builtin_libvorbis']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system libvorbis
|
env['builtin_libogg'] = False # Needed to link against system libvorbis
|
||||||
env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs')
|
env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_opus'] == 'no'):
|
if not env['builtin_opus']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system opus
|
env['builtin_libogg'] = False # Needed to link against system opus
|
||||||
env.ParseConfig('pkg-config opus opusfile --cflags --libs')
|
env.ParseConfig('pkg-config opus opusfile --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libogg'] == 'no'):
|
if not env['builtin_libogg']:
|
||||||
env.ParseConfig('pkg-config ogg --cflags --libs')
|
env.ParseConfig('pkg-config ogg --cflags --libs')
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
|
||||||
# Linkflags below this line should typically stay the last ones
|
# Linkflags below this line should typically stay the last ones
|
||||||
if (env['builtin_zlib'] == 'no'):
|
if not env['builtin_zlib']:
|
||||||
env.ParseConfig('pkg-config zlib --cflags --libs')
|
env.ParseConfig('pkg-config zlib --cflags --libs')
|
||||||
|
|
||||||
env.Append(CPPPATH=['#platform/server'])
|
env.Append(CPPPATH=['#platform/server'])
|
||||||
|
|
|
@ -62,10 +62,10 @@ def get_opts():
|
||||||
def get_flags():
|
def get_flags():
|
||||||
|
|
||||||
return [
|
return [
|
||||||
('builtin_freetype', 'no'),
|
('builtin_freetype', False),
|
||||||
('builtin_libpng', 'no'),
|
('builtin_libpng', False),
|
||||||
('builtin_openssl', 'no'),
|
('builtin_openssl', False),
|
||||||
('builtin_zlib', 'no'),
|
('builtin_zlib', False),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,64 +137,64 @@ def configure(env):
|
||||||
|
|
||||||
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
|
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
|
||||||
|
|
||||||
if (env['builtin_openssl'] == 'no'):
|
if not env['builtin_openssl']:
|
||||||
env.ParseConfig('pkg-config openssl --cflags --libs')
|
env.ParseConfig('pkg-config openssl --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libwebp'] == 'no'):
|
if not env['builtin_libwebp']:
|
||||||
env.ParseConfig('pkg-config libwebp --cflags --libs')
|
env.ParseConfig('pkg-config libwebp --cflags --libs')
|
||||||
|
|
||||||
# freetype depends on libpng and zlib, so bundling one of them while keeping others
|
# freetype depends on libpng and zlib, so bundling one of them while keeping others
|
||||||
# as shared libraries leads to weird issues
|
# as shared libraries leads to weird issues
|
||||||
if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'):
|
if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']:
|
||||||
env['builtin_freetype'] = 'yes'
|
env['builtin_freetype'] = True
|
||||||
env['builtin_libpng'] = 'yes'
|
env['builtin_libpng'] = True
|
||||||
env['builtin_zlib'] = 'yes'
|
env['builtin_zlib'] = True
|
||||||
|
|
||||||
if (env['builtin_freetype'] == 'no'):
|
if not env['builtin_freetype']:
|
||||||
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
env.ParseConfig('pkg-config freetype2 --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libpng'] == 'no'):
|
if not env['builtin_libpng']:
|
||||||
env.ParseConfig('pkg-config libpng --cflags --libs')
|
env.ParseConfig('pkg-config libpng --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_enet'] == 'no'):
|
if not env['builtin_enet']:
|
||||||
env.ParseConfig('pkg-config libenet --cflags --libs')
|
env.ParseConfig('pkg-config libenet --cflags --libs')
|
||||||
|
|
||||||
if env['builtin_squish'] == 'no' and env['tools']:
|
if not env['builtin_squish'] and env['tools']:
|
||||||
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
env.ParseConfig('pkg-config libsquish --cflags --libs')
|
||||||
|
|
||||||
if env['builtin_zstd'] == 'no':
|
if not env['builtin_zstd']:
|
||||||
env.ParseConfig('pkg-config libzstd --cflags --libs')
|
env.ParseConfig('pkg-config libzstd --cflags --libs')
|
||||||
|
|
||||||
# Sound and video libraries
|
# Sound and video libraries
|
||||||
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
|
# Keep the order as it triggers chained dependencies (ogg needed by others, etc.)
|
||||||
|
|
||||||
if (env['builtin_libtheora'] == 'no'):
|
if not env['builtin_libtheora']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system libtheora
|
env['builtin_libogg'] = False # Needed to link against system libtheora
|
||||||
env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora
|
env['builtin_libvorbis'] = False # Needed to link against system libtheora
|
||||||
env.ParseConfig('pkg-config theora theoradec --cflags --libs')
|
env.ParseConfig('pkg-config theora theoradec --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libvpx'] == 'no'):
|
if not env['builtin_libvpx']:
|
||||||
env.ParseConfig('pkg-config vpx --cflags --libs')
|
env.ParseConfig('pkg-config vpx --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libvorbis'] == 'no'):
|
if not env['builtin_libvorbis']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system libvorbis
|
env['builtin_libogg'] = False # Needed to link against system libvorbis
|
||||||
env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs')
|
env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_opus'] == 'no'):
|
if not env['builtin_opus']:
|
||||||
env['builtin_libogg'] = 'no' # Needed to link against system opus
|
env['builtin_libogg'] = False # Needed to link against system opus
|
||||||
env.ParseConfig('pkg-config opus opusfile --cflags --libs')
|
env.ParseConfig('pkg-config opus opusfile --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libogg'] == 'no'):
|
if not env['builtin_libogg']:
|
||||||
env.ParseConfig('pkg-config ogg --cflags --libs')
|
env.ParseConfig('pkg-config ogg --cflags --libs')
|
||||||
|
|
||||||
if (env['builtin_libtheora'] != 'no'):
|
if env['builtin_libtheora']:
|
||||||
list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
|
list_of_x86 = ['x86_64', 'x86', 'i386', 'i586']
|
||||||
if any(platform.machine() in s for s in list_of_x86):
|
if any(platform.machine() in s for s in list_of_x86):
|
||||||
env["x86_libtheora_opt_gcc"] = True
|
env["x86_libtheora_opt_gcc"] = True
|
||||||
|
|
||||||
# On Linux wchar_t should be 32-bits
|
# On Linux wchar_t should be 32-bits
|
||||||
# 16-bit library shouldn't be required due to compiler optimisations
|
# 16-bit library shouldn't be required due to compiler optimisations
|
||||||
if (env['builtin_pcre2'] == 'no'):
|
if not env['builtin_pcre2']:
|
||||||
env.ParseConfig('pkg-config libpcre2-32 --cflags --libs')
|
env.ParseConfig('pkg-config libpcre2-32 --cflags --libs')
|
||||||
|
|
||||||
## Flags
|
## Flags
|
||||||
|
@ -226,7 +226,7 @@ def configure(env):
|
||||||
print("libudev development libraries not found, disabling udev support")
|
print("libudev development libraries not found, disabling udev support")
|
||||||
|
|
||||||
# Linkflags below this line should typically stay the last ones
|
# Linkflags below this line should typically stay the last ones
|
||||||
if (env['builtin_zlib'] == 'no'):
|
if not env['builtin_zlib']:
|
||||||
env.ParseConfig('pkg-config zlib --cflags --libs')
|
env.ParseConfig('pkg-config zlib --cflags --libs')
|
||||||
|
|
||||||
env.Append(CPPPATH=['#platform/x11'])
|
env.Append(CPPPATH=['#platform/x11'])
|
||||||
|
|
Loading…
Reference in New Issue