[PATCH] D56219: [gn build] Add build files for LLVM unittests with a custom main() function

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 20:35:01 PST 2019


thakis marked an inline comment as done.
thakis added inline comments.


================
Comment at: llvm/utils/gn/secondary/llvm/utils/unittest/unittest.gni:49
+    }
+    if (has_custom_main) {
+      deps += [ "//llvm/utils/unittest:gtest" ]
----------------
I tried doing `if (defined(invoker.has_custom_main) && invoker.has_custom_main)` but then GN claimed:

```
FAILED: build.ninja 
../../../gn/out/gn --root=../.. -q --dotfile=../../llvm/utils/gn/.gn gen .
ERROR at //llvm/unittests/CodeGen/GlobalISel/BUILD.gn:19:21: Assignment had no effect.
  has_custom_main = true
                    ^---
You set the variable "has_custom_main" here and it was unused before it went
out of scope.
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56219/new/

https://reviews.llvm.org/D56219





More information about the llvm-commits mailing list