Skip to content

Commit 2f2804c

Browse files
committed
Update build property to compiler.cpp.extra_flags
1 parent 57aa14f commit 2f2804c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

build_platform.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
# optional wippersnapper argument to generate a dependencies header file
3333
PRINT_DEPENDENCIES_AS_HEADER = False
34-
# if "--print_dependencies_as_header" in sys.argv:
35-
# PRINT_DEPENDENCIES_AS_HEADER = True
36-
# sys.argv.remove("--print_dependencies_as_header")
37-
#
3834
INCLUDE_PRINT_DEPENDENCIES_HEADER = False
3935
if "--include_print_dependencies_header" in sys.argv:
4036
INCLUDE_PRINT_DEPENDENCIES_HEADER = True
@@ -391,9 +387,15 @@ def extract_dependencies(output):
391387
return dependencies
392388

393389
def write_dependencies_to_header(dependencies, output_file):
390+
# header file
394391
with open(output_file, 'w') as f:
395392
f.write('#ifndef PROJECT_DEPENDENCIES_H\n')
396393
f.write('#define PROJECT_DEPENDENCIES_H\n\n')
394+
f.write('extern const char* project_dependencies;\n\n')
395+
f.write('#endif // PROJECT_DEPENDENCIES_H\n')
396+
# cpp file
397+
with open(re.sub(r'\.h$','.cpp'), 'w') as f:
398+
f.write('#include "print_dependencies.h"\n\n')
397399
f.write('const char* project_dependencies = R"(\n')
398400

399401
f.write('Libraries and Versions:\n')
@@ -405,7 +407,6 @@ def write_dependencies_to_header(dependencies, output_file):
405407
f.write(f'Platform: {plat[0].strip()}, Version: {plat[1].strip()}\n')
406408

407409
f.write(')";\n\n')
408-
f.write('#endif // PROJECT_DEPENDENCIES_H\n')
409410

410411
def test_examples_in_folder(platform, folderpath):
411412
global success, BUILD_TIMEOUT, popen_timeout, BUILD_WALL, BUILD_WARN, PRINT_DEPENDENCIES_AS_HEADER, INCLUDE_PRINT_DEPENDENCIES_HEADER, IS_LEARNING_SYS, BUILD_DIR
@@ -470,7 +471,7 @@ def test_examples_in_folder(platform, folderpath):
470471
cmd.append('--no-color')
471472
elif INCLUDE_PRINT_DEPENDENCIES_HEADER:
472473
cmd.append('--build-property')
473-
cmd.append('"build.extra_flags=\'-DPRINT_DEPENDENCIES\'"')
474+
cmd.append('"compiler.cpp.extra_flags=-DPRINT_DEPENDENCIES"')
474475
cmd.append('--verbose')
475476

476477
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)