[llvm] r348993 - [gn build] Fix defines define on Windows

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 15:57:21 PST 2018


Author: smeenai
Date: Wed Dec 12 15:57:21 2018
New Revision: 348993

URL: http://llvm.org/viewvc/llvm-project?rev=348993&view=rev
Log:
[gn build] Fix defines define on Windows

On Windows, we won't go into the `host_os != "win"` block, so `defines`
won't have been defined, and we'll run into an undefined identifier
error when we try to later append to it. Unconditionally define it at
the start and append to it everywhere else.

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

Modified:
    llvm/trunk/utils/gn/build/BUILD.gn

Modified: llvm/trunk/utils/gn/build/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/BUILD.gn?rev=348993&r1=348992&r2=348993&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/BUILD.gn (original)
+++ llvm/trunk/utils/gn/build/BUILD.gn Wed Dec 12 15:57:21 2018
@@ -3,9 +3,11 @@ import("//llvm/utils/gn/build/mac_sdk.gn
 import("//llvm/utils/gn/build/toolchain/compiler.gni")
 
 config("compiler_defaults") {
+  defines = []
+
   # FIXME: Don't define this globally here.
   if (host_os != "win") {
-    defines = [ "LLVM_ON_UNIX" ]
+    defines += [ "LLVM_ON_UNIX" ]
   }
 
   if (!llvm_enable_assertions) {




More information about the llvm-commits mailing list