Skip to content

Commit cc132ec

Browse files
author
Me No Dev
committed
Merge remote-tracking branch 'esp8266/master'
2 parents 2aa3d3e + 79ce122 commit cc132ec

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/build.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@
3232
def compile(tmp_dir, sketch, tools_dir, hardware_dir, ide_path, f, args):
3333
cmd = ide_path + '/arduino-builder '
3434
cmd += '-compile -logger=human '
35+
cmd += '-build-path "' + tmp_dir + '" '
36+
cmd += '-tools "' + ide_path + '/tools-builder" '
3537
if args.library_path:
3638
for lib_dir in args.library_path:
3739
cmd += '-libraries "' + lib_dir + '" '
38-
cmd += '-build-path "' + tmp_dir + '" '
3940
cmd += '-hardware "' + ide_path + '/hardware" '
40-
cmd += '-hardware ' + hardware_dir + ' '
41-
cmd += '-tools "' + ide_path + '/tools-builder" '
41+
if args.hardware_dir:
42+
for hw_dir in args.hardware_dir:
43+
cmd += '-hardware "' + hw_dir + '" '
44+
else:
45+
cmd += '-hardware "' + hardware_dir + '" '
4246
# Debug=Serial,DebugLevel=Core____
4347
cmd += '-fqbn=esp8266com:esp8266:{board_name}:' \
4448
'CpuFrequency={cpu_freq},' \
@@ -72,6 +76,8 @@ def parse_args():
7276
parser.add_argument('-p', '--build_path', help='Build directory')
7377
parser.add_argument('-l', '--library_path', help='Additional library path',
7478
action='append')
79+
parser.add_argument('-d', '--hardware_dir', help='Additional hardware path',
80+
action='append')
7581
parser.add_argument('-b', '--board_name', help='Board name', default='generic')
7682
parser.add_argument('-s', '--flash_size', help='Flash size', default='512K64',
7783
choices=['512K0', '512K64', '1M512', '4M1M', '4M3M'])
@@ -111,6 +117,7 @@ def main():
111117
created_tmp_dir = True
112118

113119
tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
120+
# this is not the correct hardware folder to add.
114121
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'
115122

116123
output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin'

0 commit comments

Comments
 (0)