[gn build] Fix cosmetic bug in write_cmake_config.py

Before, #cmakedefine FOO resulted in #define FOO  with a trailing space if FOO
was set to something truthy. Make it so that it's just #define FOO without a
trailing space.

No functional difference.

Differential Revision: https://reviews.llvm.org/D55172

llvm-svn: 348107
This commit is contained in:
Nico Weber 2018-12-02 22:26:18 +00:00
parent e4f26eb49e
commit 1f8663044e
1 changed files with 4 additions and 4 deletions

View File

@ -72,11 +72,11 @@ def main():
_, var = in_line.split(None, 1)
try:
var, val = var.split(None, 1)
in_line = '#define %s %s' % (var, val) # val ends in \n.
except:
var, val = var.rstrip(), '\n'
if values[var]:
in_line = '#define %s %s' % (var, val)
else:
var = var.rstrip()
in_line = '#define %s\n' % var
if not values[var]:
in_line = '/* #undef %s */\n' % var
unused_values.discard(var)
out_lines.append(in_line)