Skip to content

Commit aa8bf56

Browse files
committed
add SConscript and remove library.properties
1 parent b4eb8e1 commit aa8bf56

File tree

5 files changed

+53
-13
lines changed

5 files changed

+53
-13
lines changed

SConscript

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from building import *
2+
import os
3+
4+
cwd = GetCurrentDir()
5+
group = []
6+
7+
list = os.listdir(cwd)
8+
for item in list:
9+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
10+
group = group + SConscript(os.path.join(item, 'SConscript'))
11+
12+
Return('group')

examples/SConscript

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from building import *
2+
import os
3+
4+
cwd = GetCurrentDir()
5+
group = []
6+
7+
list = os.listdir(cwd)
8+
for item in list:
9+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
10+
group = group + SConscript(os.path.join(item, 'SConscript'))
11+
12+
Return('group')

examples/hello_world/SConscript

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from building import *
2+
3+
src = Glob('*.c') + Glob('*.cpp')
4+
5+
group = DefineGroup('RTduino-libraries', src,
6+
CPPPATH = [GetCurrentDir()],
7+
depend = ['PKG_USING_ARDUINO_TENSORFLOW_LITE_MICRO_EXAMPLE_HELLO_WORLD'])
8+
9+
Return('group')

library.properties

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/SConscript

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from building import *
2+
import os
3+
4+
current_dir = GetCurrentDir()
5+
src = []
6+
7+
# find the src folder's sub-folders and sub-files recursively
8+
for root, dirs, files in os.walk(current_dir):
9+
for dir in dirs: # add all sub-folders' header files' path
10+
_sub_path = os.path.join(root,dir) # sub-folder path
11+
# add all .c/cpp file and .h/hpp file
12+
src = src + Glob(os.path.join(_sub_path, '*.c'))
13+
src = src + Glob(os.path.join(_sub_path, '*.cpp'))
14+
15+
group = DefineGroup('RTduino-libraries', src,
16+
CPPPATH = [current_dir],
17+
CPPDEFINES = ['TF_LITE_STRIP_ERROR_STRINGS'],
18+
depend = ['PKG_USING_ARDUINO_TENSORFLOW_LITE_MICRO'])
19+
20+
Return('group')

0 commit comments

Comments
 (0)