From b267cbabba0c7ebceedaa94091b128d4e4f7cb22 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 19 May 2016 12:59:54 -0700 Subject: [PATCH] Error on USE_CLANG_PLATFORM_BUILD= A blank USE_CLANG_PLATFORM_BUILD= on the command line for make causes confusion between make and kati. make ignores writes to variables set on the command line, so envsetup.mk cannot set it to true, USE_CLANG_PLATFORM_BUILD is still empty in soong.mk, and soong.variables gets DeviceUsesClang: false. kati gets USE_CLANG_PLATFORM_BUILD= in its environment instead of on its command line, so envsetup.mk when parsed by kati sets USE_CLANG_PLATFORM_BUILD=true. Error out early if USE_CLANG_PLATFORM_BUILD is not true or false after attempting to set it to true if it is empty. Change-Id: I0e2731315711db9a6ac6ea2bf49c88bccacd35f7 --- core/envsetup.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/envsetup.mk b/core/envsetup.mk index c3cd3c5a9e..1a79ce238c 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -475,3 +475,9 @@ endif ifeq ($(USE_CLANG_PLATFORM_BUILD),) USE_CLANG_PLATFORM_BUILD := true endif + +ifneq ($(USE_CLANG_PLATFORM_BUILD),true) +ifneq ($(USE_CLANG_PLATFORM_BUILD),false) +$(error USE_CLANG_PLATFORM_BUILD must be true or false) +endif +endif