From 2d56ac1f2c8a76dfe07729f8a5a31697678d17bd Mon Sep 17 00:00:00 2001 From: Shoaib Meenai Date: Wed, 12 Dec 2018 23:57:21 +0000 Subject: [PATCH] [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 llvm-svn: 348993 --- utils/gn/build/BUILD.gn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/gn/build/BUILD.gn b/utils/gn/build/BUILD.gn index 0f369ec7395..37aa4311651 100644 --- a/utils/gn/build/BUILD.gn +++ b/utils/gn/build/BUILD.gn @@ -3,9 +3,11 @@ import("//llvm/utils/gn/build/mac_sdk.gni") 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) {