@@ -2497,10 +2497,23 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
2497
2497
2498
2498
build_path = build
2499
2499
2500
+ def safe_append_profile_to_build_path (bp ):
2501
+ if profile :
2502
+ if isinstance (profile , basestring ):
2503
+ append_str = profile
2504
+ else :
2505
+ append_str = profile [0 ]
2506
+
2507
+ if append_str :
2508
+ bp = os .path .join (bp , os .path .splitext (os .path .basename (append_str ))[0 ].upper ())
2509
+
2510
+ return bp
2511
+
2500
2512
if compile_library :
2501
2513
# Compile as a library (current dir is default)
2502
2514
if not build_path :
2503
2515
build_path = os .path .join (os .path .relpath (program .path , orig_path ), program .build_dir , 'libraries' , os .path .basename (orig_path ), target .upper (), tchain .upper ())
2516
+ build_path = safe_append_profile_to_build_path (build_path )
2504
2517
2505
2518
popen ([python_cmd , '-u' , os .path .join (tools_dir , 'build.py' )]
2506
2519
+ list (chain .from_iterable (zip (repeat ('-D' ), macros )))
@@ -2517,6 +2530,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
2517
2530
# Compile as application (root is default)
2518
2531
if not build_path :
2519
2532
build_path = os .path .join (os .path .relpath (program .path , orig_path ), program .build_dir , target .upper (), tchain .upper ())
2533
+ build_path = safe_append_profile_to_build_path (build_path )
2520
2534
2521
2535
popen ([python_cmd , '-u' , os .path .join (tools_dir , 'make.py' )]
2522
2536
+ list (chain .from_iterable (zip (repeat ('-D' ), macros )))
0 commit comments