Concatenate string literals in get_define

If get_define returns a list of string_literals concatenate them into
one string.
pull/3744/head
Christoph Behle 7 years ago committed by Nirbheek Chauhan
parent 4edec259ca
commit 8ef4216f01
  1. 7
      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':

Loading…
Cancel
Save