提交 ce426364 编写于 作者: c00244171's avatar c00244171

add cmd --compile-config enable_mesa3d

Signed-off-by: c00244171's avatarchenmudan <chenmudan@huawei.com>

Change-Id: I7e3e75d9d157ea3c2d9cb02b695d967485e86133
上级 f8dd2725
......@@ -43,7 +43,11 @@ def add_options(parser):
parser.add_argument('-cpu',
'--target-cpu',
help='select cpu',
default="")
default="")
parser.add_argument('-cc',
'--compile-config',
help='Compile the configuration',
default=False)
parser.add_argument('--dmverity',
help='enable dmverity',
action="store_true")
......@@ -138,6 +142,9 @@ def exec_command(args):
if args.target_cpu:
cmd_args['target_cpu'] = args.target_cpu
if args.compile_config:
cmd_args['compile_config']= args.compile_config
if args.dmverity:
build.register_args('enable_ohos_security_dmverity',
......
......@@ -132,7 +132,9 @@ class Build():
def build(self, full_compile, patch=False, ninja=True, cmd_args=None):
if 'target_cpu' in str(cmd_args):
self.config.target_cpu = cmd_args["target_cpu"]
self.config.target_cpu = cmd_args["target_cpu"]
if 'compile_config' in str(cmd_args):
self.config.compile_config = cmd_args["compile_config"]
cmd_list = self.get_cmd(full_compile, patch, ninja, cmd_args)
# enable ccache if it installed.
......
......@@ -49,6 +49,7 @@ class Config(metaclass=Singleton):
self._target_cpu = config_content.get('target_cpu', None)
self._target_os = config_content.get('target_os', None)
self._out_path = config_content.get('out_path', None)
self._compile_config = config_content.get('compile_config', None)
self._component_type = config_content.get('component_type', None)
self.fs_attr = set()
self.platform = platform.system()
......@@ -88,6 +89,15 @@ class Config(metaclass=Singleton):
def version(self, value):
self._version = value
self.config_update('version', self._version)
@property
def compile_config(self):
return self._compile_config
@compile_config.setter
def compile_config(self, value):
self._compile_config = value
self.config_update('compile_config', self._compile_config)
@property
def os_level(self):
......
......@@ -477,12 +477,20 @@ class Preloader():
@target_cpu.setter
def target_cpu(self, value):
self._target_cpu = value
@property
def compile_config(self):
return self._compile_config
@target_cpu.setter
def compile_config(self, value):
self._compile_config = value
def __init__(self, config):
# All kinds of directories and subsystem_config_json
self._dirs = Dirs(config)
self._target_cpu = config.target_cpu
self._target_cpu = config.target_cpu
self._compile_config = config.compile_config
# Product & Device
self._product = MyProduct(config.product, self._dirs,
......@@ -499,7 +507,9 @@ class Preloader():
device_info = self._device.get_device_info()
if device_info:
if self._target_cpu:
device_info["target_cpu"] = self._target_cpu
device_info["target_cpu"] = self._target_cpu
if self._compile_config:
device_info[self._compile_config] = True
build_vars.update(device_info)
dump_json_file(self._outputs.systemcapability_json, self._product._syscap_info)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册