Skip to content

Commit

Permalink
optimize compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Jan 13, 2025
1 parent 3417b4b commit 5bbd2ca
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/maix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD_S
###############################################

###### Add required/dependent components ######
list(APPEND ADD_REQUIREMENTS pybind11 python3 basic nn peripheral vision comm network voice vision_extra
ext_dev ext_dev_mlx90640 ext_dev_tof100)
# list(APPEND ADD_REQUIREMENTS pybind11 python3 basic nn peripheral vision comm network voice vision_extra
# ext_dev ext_dev_mlx90640 ext_dev_tof100)
###############################################

###### Add link search path for requirements/libs ######
Expand Down
43 changes: 43 additions & 0 deletions components/maix/component.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import os

def add_file_downloads(confs : dict) -> list:
'''
@param confs kconfig vars, dict type
@return list type, items is dict type
'''
# url = "https://phoenixnap.dl.sourceforge.net/project/asio/asio/1.28.0%20%28Stable%29/asio-1.28.0.tar.gz"
# sha256sum = "e854a53cc6fe599bdf830e3c607f1d22fe74eee892f64c81d3ca997a80ddca97"
# filename = "asio-1.28.0.tar.gz"

return [
# {
# 'url': f'{url}',
# 'urls': [],
# 'sites': ['https://sourceforge.net/projects/asio/files/asio/1.28.0%20%28Stable%29/'],
# 'sha256sum': sha256sum,
# 'filename': filename,
# 'path': 'asio',
# 'check_files': [
# 'asio-1.28.0'
# ]
# }
]

def add_requirements(component_dirs : list):
requires = [
"pybind11", "python3", "basic", "nn", "peripheral", "vision", "comm", "network", "voice", "vision_extra"
]
# add all components in ext_devs
for dir in component_dirs:
names = os.listdir(dir)
if "ext_devs" in names:
names = os.listdir(os.path.join(dir, "ext_devs"))
for name in names:
path = os.path.join(dir, "ext_devs", name)
py_paty = os.path.join(path, "component.py")
cmake_path = os.path.join(path, "CMakeLists.txt")
if os.path.exists(py_paty) or os.path.exists(cmake_path):
requires.append(name)
break
return requires

0 comments on commit 5bbd2ca

Please sign in to comment.