Skip to content

Commit ab0fc59

Browse files
screamermshawcroft
authored andcommitted
Add support for project naming based on current directory Cleanup print output
1 parent 228d831 commit ab0fc59

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/build_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from types import ListType
2424
from shutil import rmtree
2525
from os.path import join, exists, basename
26+
from os import getcwd
2627
from time import time
2728

2829
from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException
@@ -91,15 +92,15 @@ def build_project(src_path, build_path, target, toolchain_name,
9192
# We need to remove all paths which are repeated to avoid
9293
# multiple compilations and linking with the same objects
9394
src_paths = [src_paths[0]] + list(set(src_paths[1:]))
94-
PROJECT_BASENAME = basename(src_paths[0])
95+
project_name = basename(src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd())
9596

9697
if name is None:
9798
# We will use default project name based on project folder name
98-
name = PROJECT_BASENAME
99-
toolchain.info("Building project %s (%s, %s)" % (PROJECT_BASENAME.upper(), target.name, toolchain_name))
99+
name = project_name
100+
toolchain.info("Building project %s (%s, %s)" % (project_name, target.name, toolchain_name))
100101
else:
101102
# User used custom global project name to have the same name for the
102-
toolchain.info("Building project %s to %s (%s, %s)" % (PROJECT_BASENAME.upper(), name, target.name, toolchain_name))
103+
toolchain.info("Building project %s to %s (%s, %s)" % (project_name, name, target.name, toolchain_name))
103104

104105

105106
if report != None:

tools/toolchains/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ def compile_sources(self, resources, build_path, inc_dirs=None):
496496
for source in files_to_compile:
497497
_, name, _ = split_path(source)
498498
object = self.relative_object_path(build_path, base_path, source)
499-
print object
500499

501500
# Queue mode (multiprocessing)
502501
commands = self.compile_command(source, object, inc_paths)

0 commit comments

Comments
 (0)