提交 95ae72e3 编写于 作者: O openharmony_ci 提交者: Gitee

!289 新增Board SoC分离的架构适配

Merge pull request !289 from SimonLi/master
......@@ -94,8 +94,11 @@ group("ohos") {
# Skip device target for userspace only scenario.
if (!ohos_build_userspace_only) {
# Step 7: Add device and product target by default.
# liteos_m kernel organise device build targets, but not by default.
if (product_cfg.kernel_type != "liteos_m") {
deps += [ "${device_path}/../" ]
}
}
} else {
deps += string_split(ohos_build_target, "&&")
}
......
......@@ -40,6 +40,7 @@ CONFIG_STRUCT = {
"product": None,
"product_path": None,
"device_path": None,
"device_company": None,
"patch_cache": None
}
......
......@@ -248,6 +248,7 @@ class Build():
gn_kernel_path = device_path
self.register_args('ohos_build_target', [gn_device_path])
self.register_args('device_path', gn_kernel_path)
self.register_args('device_company', self.config.device_company)
self.register_args('ohos_kernel_type', kernel)
else:
# Compile product in "hb set"
......@@ -256,6 +257,7 @@ class Build():
if self._compact_mode:
self.register_args('product_name', self.config.product)
self.register_args('device_path', self.config.device_path)
self.register_args('device_company', self.config.device_company)
self.register_args('ohos_kernel_type', self.config.kernel)
product_json = os.path.join(self.config.product_path,
......
......@@ -41,6 +41,7 @@ class Config(metaclass=Singleton):
self._product = config_content.get('product', None)
self._product_path = config_content.get('product_path', None)
self._device_path = config_content.get('device_path', None)
self._device_company = config_content.get('device_company', None)
self._patch_cache = config_content.get('patch_cache', None)
self._out_path = None
self.fs_attr = set()
......@@ -77,6 +78,18 @@ class Config(metaclass=Singleton):
self._board = value
self.config_update('board', self._board)
@property
def device_company(self):
if self._device_company is None:
raise OHOSException('Please run command "hb set" to '
'init OHOS development environment')
return self._device_company
@device_company.setter
def device_company(self, value):
self._device_company = value
self.config_update('device_company', self._device_company)
@property
def kernel(self):
if self._kernel is None:
......
......@@ -33,6 +33,7 @@ def exec_command(args):
product = json_data.get('product', 'not set')
product_path = json_data.get('product_path', 'not set')
device_path = json_data.get('device_path', 'not set')
device_company = json_data.get('device_company', 'not set')
hb_info('root path: {}'.format(root_path))
hb_info('board: {}'.format(board))
......@@ -40,3 +41,4 @@ def exec_command(args):
hb_info('product: {}'.format(product))
hb_info('product path: {}'.format(product_path))
hb_info('device path: {}'.format(device_path))
hb_info('device company: {}'.format(device_company))
......@@ -69,11 +69,16 @@ def set_product(product_name=None, company=None):
config.product_path = product_path
product_json = os.path.join(config.product_path, 'config.json')
config.board, config.kernel, kernel_version, dev_company =\
config.board, config.kernel, kernel_version, device_company =\
Product.get_device_info(product_json)
config.device_company = device_company
board_path = os.path.join(config.root_path, 'device',
dev_company, config.board)
device_company, config.board)
# board and soc decoupling feature will add boards directory path here.
if not os.path.exists(board_path):
board_path = os.path.join(config.root_path, 'device', 'board',
device_company, config.board)
config.device_path = Device.get_device_path(board_path,
config.kernel,
kernel_version)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册