diff options
author | Christoph Behle <behlec@gmail.com> | 2018-06-09 19:10:14 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-06-12 00:14:54 +0000 |
commit | 8ef4216f01fd470a0fd1a9446b30b993f32dd88c (patch) | |
tree | 3cd25db007b0c1ef764275d6327ca174d16ce889 /mesonbuild/compilers/c.py | |
parent | 4edec259cac2535f3d2f73451f53e5ac3ddb2e11 (diff) | |
download | meson-8ef4216f01fd470a0fd1a9446b30b993f32dd88c.zip meson-8ef4216f01fd470a0fd1a9446b30b993f32dd88c.tar.gz meson-8ef4216f01fd470a0fd1a9446b30b993f32dd88c.tar.bz2 |
Concatenate string literals in get_define
If get_define returns a list of string_literals concatenate them into
one string.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r-- | mesonbuild/compilers/c.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 323e855..1bc4dfd 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import subprocess, os.path +import subprocess, os.path, ast from .. import mlog from .. import coredata @@ -567,8 +567,9 @@ class CCompiler(Compiler): if p.returncode != 0: raise EnvironmentException('Could not get define {!r}'.format(dname)) # Get the preprocessed value after the delimiter, - # minus the extra newline at the end - return p.stdo.split(delim + '\n')[-1][:-1] + # minus the extra newline at the end and + # merge string literals. + return ast.literal_eval(p.stdo.split(delim + '\n')[-1][:-1]) def get_return_value(self, fname, rtype, prefix, env, extra_args, dependencies): if rtype == 'string': |