Compare commits
3
Commits
f9a2a2e0d9
...
3ada35e863
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ada35e863 | ||
|
|
df5cc85fa7 | ||
|
|
72c5619f59 |
@@ -171,13 +171,13 @@
|
||||
}
|
||||
```
|
||||
|
||||
- **sources**: 源文件列表(相对配置文件路径);
|
||||
- **sources**: 源文件列表,应为相对当前配置文件的路径,可使用通配符。例如,`"src/*"` 会将配置文件所在目录下的 `src` 文件夹中的所有文件复制或链接到相应工程目录下的 `src` 文件夹中。
|
||||
- **target_cpu**: 目标 CPU ID[^2];
|
||||
- **os**: 操作系统类型[^1],必须与 BSP/Domain 匹配;
|
||||
- **language**: 编程语言,"C" 或 "C++";
|
||||
- *bsp*: 应用所使用的 BSP 名称,若未指定则会自动创建名为 `<os>_<cpu_id>` 的 BSP/Domain.
|
||||
- *bsp_lib*: 针对自动创建的 BSP/Domain 所使用库的配置,与 [bsps](#-bsps) 中 `libs` 对应;
|
||||
- *bsp_config*: 针对自动创建的 BSP/Domain 配置与 [bsps](#-bsps) 中 `config` 对应;
|
||||
- *bsp_lib*: 针对自动创建的 BSP/Domain 所使用库的配置,与 [bsps](#bsps) 中 `libs` 对应;
|
||||
- *bsp_config*: 针对自动创建的 BSP/Domain 配置与 [bsps](#bsps) 中 `config` 对应;
|
||||
- *mem_layout*: 应用内存布局,包括堆栈大小和堆大小等;
|
||||
-*heap_size*: 堆大小,必须写为十六进制,例如 "0x80000";
|
||||
-*stack_size*: 栈大小,必须写为十六进制,例如 "0x4000";
|
||||
|
||||
+26
-11
@@ -98,8 +98,22 @@ proc _handle_sources {app_name sources} {
|
||||
}
|
||||
|
||||
foreach source_file $sources {
|
||||
set source_path [file normalize $::root/$source_file]
|
||||
set target_path [file join $::ws $app_name [file tail $source_path]]
|
||||
# Expand wildcards
|
||||
set expanded_sources [glob -nocomplain -directory $::root $source_file]
|
||||
if {[llength $expanded_sources] == 0} {
|
||||
_error "Source file not found" "No file or directory matches $source_file"
|
||||
}
|
||||
# Hanle each expanded source
|
||||
foreach eval_source $expanded_sources {
|
||||
set relative_source [string range $eval_source [expr [string length $::root] + 1] end]
|
||||
set target_path [file join $::ws $app_name $relative_source]
|
||||
|
||||
# Ensure the target directory exists
|
||||
set target_dir [file dirname $target_path]
|
||||
if {![file exists $target_dir]} {
|
||||
file mkdir $target_dir
|
||||
_info "Created directory: $target_dir"
|
||||
}
|
||||
|
||||
# Delete existing symbolic link or file if it exists
|
||||
if {[file exists $target_path]} {
|
||||
@@ -111,19 +125,20 @@ proc _handle_sources {app_name sources} {
|
||||
switch $link_srcs {
|
||||
"y" {
|
||||
# Create symbolic link
|
||||
file link -symbolic $target_path $source_path
|
||||
_info "Created symbolic link: $target_path -> $source_path"
|
||||
file link -symbolic $target_path $eval_source
|
||||
_info "Created symbolic link: $target_path -> $eval_source"
|
||||
}
|
||||
"n" {
|
||||
# Copy the source file
|
||||
file copy $source_path $target_path
|
||||
_info "Copied source file: $source_path to $target_path"
|
||||
file copy $eval_source $target_path
|
||||
_info "Copied source file: $eval_source to $target_path"
|
||||
}
|
||||
default {
|
||||
_error "Unknown value for LINK_SRCS: ${link_srcs}."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc _update_app_mem_layout {app_name mem_layout} {
|
||||
@@ -181,17 +196,17 @@ proc _update_app_build_config {app_name build_type build_config is_vitis} {
|
||||
|
||||
dict for {param value} $build_config {
|
||||
switch -exact -- $param {
|
||||
"include-path" {
|
||||
"include-path" -
|
||||
"library-search-path" {
|
||||
foreach path $value {
|
||||
set path_str [format "\"\${workspace_loc:/%s/%s}\"" $app_name $path]
|
||||
eval $cmd $app_name include-path [list $path_str]
|
||||
_info "Append included path: $path for $app_name."
|
||||
eval $cmd $app_name $param [list $path_str]
|
||||
_info "Append $param: $path for $app_name."
|
||||
}
|
||||
}
|
||||
"define-compiler-symbols" -
|
||||
"undef-compiler-symbols" -
|
||||
"libraries" -
|
||||
"library-search-path" {
|
||||
"libraries" {
|
||||
foreach item $value {
|
||||
eval $cmd $app_name $param $item
|
||||
_info "Append parameter $param: $item for $app_name."
|
||||
|
||||
Reference in New Issue
Block a user