From ac627bcea723b12e17822c18cccc9dbdeaee8b8f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 18 Mar 2019 14:23:06 -0700 Subject: replace library type strings with an enum This patch creates an enum for selecting libtype as static, shared, prefer-static, or prefer-shared. This also renames 'static-shared' with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is just a refactor with no behavioral changes or user facing changes. --- mesonbuild/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/interpreter.py') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 3c3cfae..5d8d071 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1493,11 +1493,11 @@ class CompilerHolder(InterpreterObject): for i in search_dirs: if not os.path.isabs(i): raise InvalidCode('Search directory %s is not an absolute path.' % i) - libtype = 'shared-static' + libtype = mesonlib.LibType.PREFER_SHARED if 'static' in kwargs: if not isinstance(kwargs['static'], bool): raise InterpreterException('static must be a boolean') - libtype = 'static' if kwargs['static'] else 'shared' + libtype = mesonlib.LibType.STATIC if kwargs['static'] else mesonlib.LibType.SHARED linkargs = self.compiler.find_library(libname, self.environment, search_dirs, libtype) if required and not linkargs: raise InterpreterException( -- cgit v1.1