build_mbed_libs is now aware of the configuration

Previously, build_mbed_libs didn't take into account the configuration.
This is a problem when doing a binary release, since mbed_lib.json
contains configuration data relevant to the binary release.
pull/2417/head
Bogdan Marinescu 2016-08-10 19:03:13 +03:00
parent 52658e5131
commit 4f6eaaa8ec
2 changed files with 9 additions and 1 deletions

View File

@ -28,7 +28,7 @@ from time import time
import fnmatch import fnmatch
from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException, ToolException, InvalidReleaseTargetException from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException, ToolException, InvalidReleaseTargetException
from tools.paths import MBED_TARGETS_PATH, MBED_LIBRARIES, MBED_API, MBED_HAL, MBED_COMMON from tools.paths import MBED_TARGETS_PATH, MBED_LIBRARIES, MBED_API, MBED_HAL, MBED_COMMON, MBED_CONFIG_FILE
from tools.targets import TARGET_NAMES, TARGET_MAP from tools.targets import TARGET_NAMES, TARGET_MAP
from tools.libraries import Library from tools.libraries import Library
from tools.toolchains import TOOLCHAIN_CLASSES from tools.toolchains import TOOLCHAIN_CLASSES
@ -674,6 +674,12 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
toolchain.jobs = jobs toolchain.jobs = jobs
toolchain.build_all = clean toolchain.build_all = clean
# Take into account the library configuration (MBED_CONFIG_FILE)
config = Config(target)
toolchain.config = config
config.add_config_files([MBED_CONFIG_FILE])
toolchain.set_config_data(toolchain.config.get_config_data())
# Source and Build Paths # Source and Build Paths
BUILD_TARGET = join(MBED_LIBRARIES, "TARGET_" + target.name) BUILD_TARGET = join(MBED_LIBRARIES, "TARGET_" + target.name)
BUILD_TOOLCHAIN = join(BUILD_TARGET, "TOOLCHAIN_" + toolchain.name) BUILD_TOOLCHAIN = join(BUILD_TARGET, "TOOLCHAIN_" + toolchain.name)

View File

@ -40,6 +40,8 @@ MBED_TARGETS_PATH = join(MBED_BASE, "targets")
MBED_LIBRARIES = join(BUILD_DIR, "mbed") MBED_LIBRARIES = join(BUILD_DIR, "mbed")
MBED_CONFIG_FILE = join(ROOT, "mbed_lib.json")
# Tests # Tests
TEST_DIR = join(LIB_DIR, "tests") TEST_DIR = join(LIB_DIR, "tests")
HOST_TESTS = join(ROOT, "tools", "host_tests") HOST_TESTS = join(ROOT, "tools", "host_tests")