diff --git a/core/gn.py b/core/gn.py index b4dffc85e0137406f242782fa970544eca4e7118..0b70bc57dc3e52162806fce6a78d8650d1bd96e7 100644 --- a/core/gn.py +++ b/core/gn.py @@ -1,3 +1,15 @@ +# Copyright (c) 2023-2024 DoubleByte. +# This is licensed under Mulan PSL v2. +# You can use this software according to the terms and conditions of the Mulan PSL v2. +# You may obtain a copy of Mulan PSL v2 at: +# +# http://license.coscl.org.cn/MulanPSL2 +# +# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more details. + import subprocess from util.env import getEnv diff --git a/core/main.py b/core/main.py index f9654c813ae666f6086847531bfa6be48da98f9b..761765281d1ae909956e1d117f15c9987933c545 100644 --- a/core/main.py +++ b/core/main.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 DoubleByte. +# Copyright (c) 2023-2024 DoubleByte. # This is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: @@ -20,10 +20,6 @@ from ninja import Ninja from util.path import OUT_PATH, ETC_PATH, TMP_PATH, SHARE_PATH, VAR_PATH, LOG_PATH def main(): - parser = Parser() - parser.set_compiler() - parser.write() - if not os.path.exists(OUT_PATH): os.makedirs(OUT_PATH) if not os.path.exists(ETC_PATH): @@ -37,6 +33,10 @@ def main(): if not os.path.exists(LOG_PATH): os.makedirs(LOG_PATH) + parser = Parser() + parser.set_compiler() + parser.write() + try: gn = Gn(parser) gn.run() diff --git a/core/util/parse_cmd.py b/core/util/parse_cmd.py index 452f291209d24b62cf493f72907177a7a8512661..efbcc0a9d56e272d58b7f06e84afa2fdcee08454 100644 --- a/core/util/parse_cmd.py +++ b/core/util/parse_cmd.py @@ -77,7 +77,7 @@ class Parser: self.parser.add_argument('-compiler', dest='compiler', default=self.compiler, type=str) def write(self): - with open('build_config.json', 'w') as file: + with open(f'{self.out_path_}/build_config.json', 'w') as file: json.dump(vars(self.parser.parse_args()), file, indent = 2) def get_gn_args_list(self):