projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ada01d1
)
[gn build] find mistakes like the one fixed in 72b5989e0d1 at build time
author
Nico Weber
<thakis@chromium.org>
Wed, 15 Jan 2020 15:05:25 +0000
(10:05 -0500)
committer
Nico Weber
<thakis@chromium.org>
Wed, 15 Jan 2020 15:05:41 +0000
(10:05 -0500)
llvm/utils/gn/build/write_cmake_config.py
patch
|
blob
|
history
diff --git
a/llvm/utils/gn/build/write_cmake_config.py
b/llvm/utils/gn/build/write_cmake_config.py
index
d76d14b
..
ef70648
100755
(executable)
--- a/
llvm/utils/gn/build/write_cmake_config.py
+++ b/
llvm/utils/gn/build/write_cmake_config.py
@@
-73,6
+73,11
@@
def main():
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 '):