[llvm] r348107 - [gn build] Fix cosmetic bug in write_cmake_config.py
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 2 14:26:18 PST 2018
Author: nico
Date: Sun Dec 2 14:26:18 2018
New Revision: 348107
URL: http://llvm.org/viewvc/llvm-project?rev=348107&view=rev
Log:
[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
Modified:
llvm/trunk/utils/gn/build/write_cmake_config.py
Modified: llvm/trunk/utils/gn/build/write_cmake_config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/write_cmake_config.py?rev=348107&r1=348106&r2=348107&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/write_cmake_config.py (original)
+++ llvm/trunk/utils/gn/build/write_cmake_config.py Sun Dec 2 14:26:18 2018
@@ -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)
More information about the llvm-commits
mailing list