diff options
author | Aleksey Gurtovoy <agurtovoy@acm.org> | 2019-08-09 16:06:47 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-05 23:42:47 +0300 |
commit | 75daed27bc4e363696157617c7461414fc4e707b (patch) | |
tree | 2863934de82e0a7cc6a3dcd9ee23b4c4e378c550 /mesonbuild/compilers | |
parent | caec875fe1922b40037e1fd9229433ede64f9f25 (diff) | |
download | meson-75daed27bc4e363696157617c7461414fc4e707b.zip meson-75daed27bc4e363696157617c7461414fc4e707b.tar.gz meson-75daed27bc4e363696157617c7461414fc4e707b.tar.bz2 |
mesonlib.split_args/quote_arg/join_args
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 14 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/islinker.py | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 4218775..38bf240 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import contextlib, enum, os.path, re, tempfile, shlex +import contextlib, enum, os.path, re, tempfile import typing -from typing import List, Optional, Tuple +from typing import Optional, Tuple, List from ..linkers import StaticLinker, GnuLikeDynamicLinkerMixin from .. import coredata @@ -22,7 +22,7 @@ from .. import mlog from .. import mesonlib from ..mesonlib import ( EnvironmentException, MachineChoice, MesonException, OrderedSet, - Popen_safe + Popen_safe, split_args ) from ..envconfig import ( Properties, @@ -799,7 +799,7 @@ class Compiler: env_compile_flags = os.environ.get(cflags_mapping[lang]) log_var(cflags_mapping[lang], env_compile_flags) if env_compile_flags is not None: - compile_flags += shlex.split(env_compile_flags) + compile_flags += split_args(env_compile_flags) # Link flags (same for all languages) if self.use_ldflags(): @@ -820,7 +820,7 @@ class Compiler: env_preproc_flags = os.environ.get('CPPFLAGS') log_var('CPPFLAGS', env_preproc_flags) if env_preproc_flags is not None: - compile_flags += shlex.split(env_preproc_flags) + compile_flags += split_args(env_preproc_flags) return compile_flags, link_flags @@ -830,10 +830,10 @@ class Compiler: opts.update({ self.language + '_args': coredata.UserArrayOption( description + ' compiler', - [], shlex_split=True, user_input=True, allow_dups=True), + [], split_args=True, user_input=True, allow_dups=True), self.language + '_link_args': coredata.UserArrayOption( description + ' linker', - [], shlex_split=True, user_input=True, allow_dups=True), + [], split_args=True, user_input=True, allow_dups=True), }) return opts diff --git a/mesonbuild/compilers/mixins/islinker.py b/mesonbuild/compilers/mixins/islinker.py index 4c1a476..dca20d0 100644 --- a/mesonbuild/compilers/mixins/islinker.py +++ b/mesonbuild/compilers/mixins/islinker.py @@ -21,7 +21,6 @@ classes for those cases. """ import os -import shlex import typing from ... import mesonlib @@ -39,7 +38,7 @@ class LinkerEnvVarsMixin: flags = os.environ.get('LDFLAGS') if not flags: return [] - return shlex.split(flags) + return mesonlib.split_args(flags) class BasicLinkerIsCompilerMixin: |