Skip to content

Commit b8fb7a6

Browse files
committed
restructure - Changed legacy build_lib to respect lib name in path
1 parent a7ddc46 commit b8fb7a6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tools/build_api.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import tempfile
2020
from types import ListType
2121
from shutil import rmtree
22-
from os.path import join, exists, basename, abspath, normpath
22+
from os.path import join, exists, dirname, basename, abspath, normpath
2323
from os import linesep, remove
2424
from time import time
2525

@@ -755,6 +755,7 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
755755
for path in dependencies_paths:
756756
lib_resources = toolchain.scan_resources(path)
757757
dependencies_include_dir.extend(lib_resources.inc_dirs)
758+
dependencies_include_dir.extend(map(dirname, lib_resources.inc_dirs))
758759

759760
if inc_dirs:
760761
dependencies_include_dir.extend(inc_dirs)
@@ -774,8 +775,6 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
774775
for resource in resources:
775776
toolchain.copy_files(resource.headers, build_path,
776777
resources=resource)
777-
toolchain.copy_files(resource.headers, join(build_path, name),
778-
resources=resource)
779778

780779
dependencies_include_dir.extend(
781780
toolchain.scan_resources(build_path).inc_dirs)
@@ -909,12 +908,14 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
909908

910909
# Common Headers
911910
toolchain.copy_files([MBED_HEADER], MBED_LIBRARIES)
911+
library_incdirs = [dirname(MBED_LIBRARIES), MBED_LIBRARIES]
912+
912913
for dir, dest in [(MBED_DRIVERS, MBED_LIBRARIES_DRIVERS),
913914
(MBED_PLATFORM, MBED_LIBRARIES_PLATFORM),
914915
(MBED_HAL, MBED_LIBRARIES_HAL)]:
915916
resources = toolchain.scan_resources(dir)
916-
toolchain.copy_files(resources.headers, MBED_LIBRARIES)
917917
toolchain.copy_files(resources.headers, dest)
918+
library_incdirs.append(dest)
918919

919920
# Target specific sources
920921
hal_src = MBED_TARGETS_PATH
@@ -926,15 +927,15 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
926927
build_target, resources=hal_implementation)
927928
incdirs = toolchain.scan_resources(build_target).inc_dirs
928929
objects = toolchain.compile_sources(hal_implementation, tmp_path,
929-
[MBED_LIBRARIES] + incdirs)
930+
library_incdirs + incdirs)
930931

931932
# Common Sources
932933
mbed_resources = None
933934
for dir in [MBED_DRIVERS, MBED_PLATFORM, MBED_HAL]:
934935
mbed_resources += toolchain.scan_resources(dir)
935936

936937
objects += toolchain.compile_sources(mbed_resources, tmp_path,
937-
[MBED_LIBRARIES] + incdirs)
938+
library_incdirs + incdirs)
938939

939940
# A number of compiled files need to be copied as objects as opposed to
940941
# way the linker search for symbols in archives. These are:

tools/make.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
from tools.utils import args_error
3232
from tools.paths import BUILD_DIR
33+
from tools.paths import MBED_LIBRARIES
3334
from tools.paths import RTOS_LIBRARIES
3435
from tools.paths import RPC_LIBRARY
3536
from tools.paths import ETH_LIBRARY
@@ -285,6 +286,7 @@
285286
jobs=options.jobs,
286287
name=options.artifact_name,
287288
app_config=options.app_config,
289+
inc_dirs=[dirname(MBED_LIBRARIES)],
288290
build_profile=extract_profile(parser,
289291
options,
290292
toolchain))

0 commit comments

Comments
 (0)