[llvm] 252c4dc - [gn build] find mistakes like the one fixed in 72b5989e0d1 at build time
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 07:05:48 PST 2020
Author: Nico Weber
Date: 2020-01-15T10:05:41-05:00
New Revision: 252c4dce618926311bcb4715eae6955f1bc71f13
URL: https://github.com/llvm/llvm-project/commit/252c4dce618926311bcb4715eae6955f1bc71f13
DIFF: https://github.com/llvm/llvm-project/commit/252c4dce618926311bcb4715eae6955f1bc71f13.diff
LOG: [gn build] find mistakes like the one fixed in 72b5989e0d1 at build time
Added:
Modified:
llvm/utils/gn/build/write_cmake_config.py
Removed:
################################################################################
diff --git a/llvm/utils/gn/build/write_cmake_config.py b/llvm/utils/gn/build/write_cmake_config.py
index d76d14b65107..ef706488d19a 100755
--- a/llvm/utils/gn/build/write_cmake_config.py
+++ b/llvm/utils/gn/build/write_cmake_config.py
@@ -73,6 +73,11 @@ def repl(m):
in_line = var_re.sub(repl, in_line)
if in_line.startswith('#cmakedefine01 '):
_, var = in_line.split()
+ if values[var] == '0':
+ print('error: "%s=0" used with #cmakedefine01 %s' % (var, var))
+ print(" '0' evaluates as truthy with #cmakedefine01")
+ print(' use "%s=" instead' % var)
+ return 1
in_line = '#define %s %d\n' % (var, 1 if values[var] else 0)
unused_values.discard(var)
elif in_line.startswith('#cmakedefine '):
More information about the llvm-commits
mailing list