From 069baed9711a0eff27d2bc6dd7f2308ec62e2cc6 Mon Sep 17 00:00:00 2001 From: Roger Chang Date: Fri, 20 Oct 2023 11:40:24 +0800 Subject: [PATCH] scons: Explicit the config option HAVE_PROTOBUF type boolean Ensure the type of HAVE_PROTOBUF is boolean Change-Id: I9cf18c52ac290000168f5228b7f4ba3621225a85 --- src/proto/SConsopts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/proto/SConsopts b/src/proto/SConsopts index fab29bc235..6cc4a48642 100644 --- a/src/proto/SConsopts +++ b/src/proto/SConsopts @@ -57,11 +57,13 @@ with gem5_scons.Configure(main) as conf: # automatically added to the LIBS environment variable. After # this, we can use the HAVE_PROTOBUF flag to determine if we have # got both protoc and libprotobuf available. - conf.env['CONF']['HAVE_PROTOBUF'] = conf.env['HAVE_PROTOC'] and ( - (conf.env['HAVE_PKG_CONFIG'] and - conf.CheckPkgConfig('protobuf', '--cflags', '--libs')) or - conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h', - 'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;')) + conf.env['CONF']['HAVE_PROTOBUF'] = bool( + conf.env['HAVE_PROTOC'] and ( + (conf.env['HAVE_PKG_CONFIG'] and + conf.CheckPkgConfig('protobuf', '--cflags', '--libs')) or + conf.CheckLibWithHeader('protobuf', 'google/protobuf/message.h', + 'C++', 'GOOGLE_PROTOBUF_VERIFY_VERSION;')) + ) # If we have the compiler but not the library, print another warning. if main['HAVE_PROTOC'] and not main['CONF']['HAVE_PROTOBUF']: