11bd4fe43Sopenharmony_ci#!/usr/bin/env python3
21bd4fe43Sopenharmony_ci# coding=utf-8
31bd4fe43Sopenharmony_ci#
41bd4fe43Sopenharmony_ci# Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
51bd4fe43Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
61bd4fe43Sopenharmony_ci# you may not use this file except in compliance with the License.
71bd4fe43Sopenharmony_ci# You may obtain a copy of the License at
81bd4fe43Sopenharmony_ci#
91bd4fe43Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
101bd4fe43Sopenharmony_ci#
111bd4fe43Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
121bd4fe43Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
131bd4fe43Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141bd4fe43Sopenharmony_ci# See the License for the specific language governing permissions and
151bd4fe43Sopenharmony_ci# limitations under the License.
161bd4fe43Sopenharmony_ci#
171bd4fe43Sopenharmony_ciimport os
181bd4fe43Sopenharmony_cifrom scripts import common_env
191bd4fe43Sopenharmony_ciImport('env')
201bd4fe43Sopenharmony_ciImport('env_cfg')
211bd4fe43Sopenharmony_ciImport('module')
221bd4fe43Sopenharmony_ci
231bd4fe43Sopenharmony_cimodule_path = env_cfg.get_module_dir(module)
241bd4fe43Sopenharmony_ciobj_path = env_cfg.obj_path
251bd4fe43Sopenharmony_cimodule_libs = env_cfg.get_module_libs(module)
261bd4fe43Sopenharmony_cilibs = []
271bd4fe43Sopenharmony_ci
281bd4fe43Sopenharmony_cienv = env.Clone()
291bd4fe43Sopenharmony_cienv_cfg.append_environs(env, module)
301bd4fe43Sopenharmony_cicommon_env.print_log_env(env, env_cfg.get_module_dir(module))
311bd4fe43Sopenharmony_ci
321bd4fe43Sopenharmony_cifor lib in module_libs:
331bd4fe43Sopenharmony_ci    print('lib_name:',lib)
341bd4fe43Sopenharmony_ci    src_path = module_libs[lib]
351bd4fe43Sopenharmony_ci    objs = []
361bd4fe43Sopenharmony_ci    for src in src_path:
371bd4fe43Sopenharmony_ci        objs += env.SConscript(os.path.join(src, 'SConscript'), {'env':env}, variant_dir = os.path.join('#', obj_path, module_path, src), duplicate = 0)
381bd4fe43Sopenharmony_ci    libs += env.Library(lib,objs)
391bd4fe43Sopenharmony_ciReturn('libs')
40