3 Copyright (c) 2011-2013 ARM Limited
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
17 from workspace_tools.paths import *
18 from workspace_tools.data.support import *
19 from workspace_tools.tests import TEST_MBED_LIB
26 "source_dir": MBED_RTX,
27 "build_dir": RTOS_LIBRARIES,
28 "dependencies": [MBED_LIBRARIES],
32 "source_dir": RTOS_ABSTRACTION,
33 "build_dir": RTOS_LIBRARIES,
34 "dependencies": [MBED_LIBRARIES, MBED_RTX],
37 # USB Device libraries
41 "build_dir": USB_LIBRARIES,
42 "dependencies": [MBED_LIBRARIES],
48 "source_dir": USB_HOST,
49 "build_dir": USB_HOST_LIBRARIES,
50 "dependencies": [MBED_LIBRARIES, FAT_FS, MBED_RTX, RTOS_ABSTRACTION],
56 "source_dir": DSP_CMSIS,
57 "build_dir": DSP_LIBRARIES,
58 "dependencies": [MBED_LIBRARIES],
62 "source_dir": DSP_ABSTRACTION,
63 "build_dir": DSP_LIBRARIES,
64 "dependencies": [MBED_LIBRARIES, DSP_CMSIS],
67 # File system libraries
70 "source_dir": [FAT_FS, SD_FS],
71 "build_dir": FS_LIBRARY,
72 "dependencies": [MBED_LIBRARIES]
78 "source_dir": [ETH_SOURCES, LWIP_SOURCES],
79 "build_dir": ETH_LIBRARY,
80 "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES]
85 "source_dir": [UBLOX_SOURCES, CELLULAR_SOURCES, CELLULAR_USB_SOURCES, LWIP_SOURCES],
86 "build_dir": UBLOX_LIBRARY,
87 "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, USB_HOST_LIBRARIES],
90 # Unit Testing library
93 "source_dir": [CPPUTEST_SRC, CPPUTEST_PLATFORM_SRC, CPPUTEST_TESTRUNNER_SCR],
94 "build_dir": CPPUTEST_LIBRARY,
95 "dependencies": [MBED_LIBRARIES],
96 'inc_dirs': [CPPUTEST_INC, CPPUTEST_PLATFORM_INC, CPPUTEST_TESTRUNNER_INC, TEST_MBED_LIB],
97 'inc_dirs_ext': [CPPUTEST_INC_EXT],
98 'macros': ["CPPUTEST_USE_MEM_LEAK_DETECTION=0", "CPPUTEST_USE_STD_CPP_LIB=0", "CPPUTEST=1"],
103 LIBRARY_MAP = dict([(library['id'], library) for library in LIBRARIES])
108 "supported": DEFAULT_SUPPORT,
109 'dependencies': None,
110 'inc_dirs': None, # Include dirs required by library build
111 'inc_dirs_ext': None, # Include dirs required by others to use with this library
112 'macros': None, # Additional macros you want to define when building library
114 def __init__(self, lib_id):
115 self.__dict__.update(Library.DEFAULTS)
116 self.__dict__.update(LIBRARY_MAP[lib_id])
118 def is_supported(self, target, toolchain):
119 if not hasattr(self, 'supported'):
121 return (target.name in self.supported) and (toolchain in self.supported[target.name])