From ea75800d5b3be3e63c6304afed8b06a3fdeae289 Mon Sep 17 00:00:00 2001 From: liuchao Date: Wed, 6 Nov 2024 20:37:02 +0800 Subject: [PATCH] [tools] use project's dir basename as default project name --- .github/workflows/action_tools.yml | 2 +- tools/options.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action_tools.yml b/.github/workflows/action_tools.yml index ba5c624cba..6ad6d518d0 100644 --- a/.github/workflows/action_tools.yml +++ b/.github/workflows/action_tools.yml @@ -77,7 +77,7 @@ jobs: if: ${{ success() }} run: | echo "Test to dist project" - scons --dist -C $TEST_BSP_ROOT + scons --dist --project-name=project -C $TEST_BSP_ROOT scons --dist-ide -C $TEST_BSP_ROOT ls $TEST_BSP_ROOT ls $TEST_BSP_ROOT/dist diff --git a/tools/options.py b/tools/options.py index b77b675612..9b338e7311 100644 --- a/tools/options.py +++ b/tools/options.py @@ -22,8 +22,9 @@ # 2022-04-20 WuGensheng Add Options to SCons # -from SCons.Script import AddOption +from SCons.Script import AddOption, Dir import platform +import os def AddOptions(): ''' ===== Add generic options to SCons ===== ''' @@ -45,7 +46,7 @@ def AddOptions(): AddOption('--project-name', dest = 'project-name', type = 'string', - default = "project", + default = os.path.basename(Dir('#').abspath), help = 'set project name') AddOption('--cscope', dest = 'cscope',