From 45a9a680a3cf54d4f43c46c3ec43a108ee62b834 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Sep 2017 00:22:58 -0400 Subject: Use BoolVariable for third-party options. --- platform/osx/detect.py | 2 +- platform/server/detect.py | 42 ++++++++++++++++++------------------ platform/x11/detect.py | 54 +++++++++++++++++++++++------------------------ 3 files changed, 49 insertions(+), 49 deletions(-) (limited to 'platform') diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 3ae95f188d..51da000712 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -97,7 +97,7 @@ def configure(env): ## Dependencies - if (env['builtin_libtheora'] != 'no'): + if env['builtin_libtheora']: env["x86_libtheora_opt_gcc"] = True ## Flags diff --git a/platform/server/detect.py b/platform/server/detect.py index 673245ecff..94cdd0da73 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -64,60 +64,60 @@ def configure(env): # 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') - if (env['builtin_libwebp'] == 'no'): + if not env['builtin_libwebp']: env.ParseConfig('pkg-config libwebp --cflags --libs') # freetype depends on libpng and zlib, so bundling one of them while keeping others # as shared libraries leads to weird issues - if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'): - env['builtin_freetype'] = 'yes' - env['builtin_libpng'] = 'yes' - env['builtin_zlib'] = 'yes' + if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']: + env['builtin_freetype'] = True + env['builtin_libpng'] = True + env['builtin_zlib'] = True - if (env['builtin_freetype'] == 'no'): + if not env['builtin_freetype']: env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env['builtin_libpng'] == 'no'): + if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') - if (env['builtin_enet'] == 'no'): + if not env['builtin_enet']: 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') - if env['builtin_zstd'] == 'no': + if not env['builtin_zstd']: env.ParseConfig('pkg-config libzstd --cflags --libs') # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) - if (env['builtin_libtheora'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libtheora - env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora + if not env['builtin_libtheora']: + env['builtin_libogg'] = False # Needed to link against system libtheora + env['builtin_libvorbis'] = False # Needed to link against system libtheora 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') - if (env['builtin_libvorbis'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libvorbis + if not env['builtin_libvorbis']: + env['builtin_libogg'] = False # Needed to link against system libvorbis env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs') - if (env['builtin_opus'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system opus + if not env['builtin_opus']: + env['builtin_libogg'] = False # Needed to link against system opus 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') ## Flags # 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.Append(CPPPATH=['#platform/server']) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 1787bb46c4..ff7f2c9bd8 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -62,10 +62,10 @@ def get_opts(): def get_flags(): return [ - ('builtin_freetype', 'no'), - ('builtin_libpng', 'no'), - ('builtin_openssl', 'no'), - ('builtin_zlib', 'no'), + ('builtin_freetype', False), + ('builtin_libpng', False), + ('builtin_openssl', False), + ('builtin_zlib', False), ] @@ -137,64 +137,64 @@ def configure(env): # 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') - if (env['builtin_libwebp'] == 'no'): + if not env['builtin_libwebp']: env.ParseConfig('pkg-config libwebp --cflags --libs') # freetype depends on libpng and zlib, so bundling one of them while keeping others # as shared libraries leads to weird issues - if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'): - env['builtin_freetype'] = 'yes' - env['builtin_libpng'] = 'yes' - env['builtin_zlib'] = 'yes' + if env['builtin_freetype'] or env['builtin_libpng'] or env['builtin_zlib']: + env['builtin_freetype'] = True + env['builtin_libpng'] = True + env['builtin_zlib'] = True - if (env['builtin_freetype'] == 'no'): + if not env['builtin_freetype']: env.ParseConfig('pkg-config freetype2 --cflags --libs') - if (env['builtin_libpng'] == 'no'): + if not env['builtin_libpng']: env.ParseConfig('pkg-config libpng --cflags --libs') - if (env['builtin_enet'] == 'no'): + if not env['builtin_enet']: 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') - if env['builtin_zstd'] == 'no': + if not env['builtin_zstd']: env.ParseConfig('pkg-config libzstd --cflags --libs') # Sound and video libraries # Keep the order as it triggers chained dependencies (ogg needed by others, etc.) - if (env['builtin_libtheora'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libtheora - env['builtin_libvorbis'] = 'no' # Needed to link against system libtheora + if not env['builtin_libtheora']: + env['builtin_libogg'] = False # Needed to link against system libtheora + env['builtin_libvorbis'] = False # Needed to link against system libtheora 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') - if (env['builtin_libvorbis'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system libvorbis + if not env['builtin_libvorbis']: + env['builtin_libogg'] = False # Needed to link against system libvorbis env.ParseConfig('pkg-config vorbis vorbisfile --cflags --libs') - if (env['builtin_opus'] == 'no'): - env['builtin_libogg'] = 'no' # Needed to link against system opus + if not env['builtin_opus']: + env['builtin_libogg'] = False # Needed to link against system opus 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') - if (env['builtin_libtheora'] != 'no'): + if env['builtin_libtheora']: list_of_x86 = ['x86_64', 'x86', 'i386', 'i586'] if any(platform.machine() in s for s in list_of_x86): env["x86_libtheora_opt_gcc"] = True # On Linux wchar_t should be 32-bits # 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') ## Flags @@ -226,7 +226,7 @@ def configure(env): print("libudev development libraries not found, disabling udev support") # 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.Append(CPPPATH=['#platform/x11']) -- cgit v1.2.3