Added extra includes for CPPUTEST library - in CppUTest library structure we only include from include/CppUTest and we do not use other functionality

pull/683/head
Przemek Wirkus 2014-11-11 15:31:18 +00:00
parent 66cd258254
commit f408c2140b
3 changed files with 12 additions and 4 deletions

View File

@ -92,7 +92,7 @@ def build_project(src_path, build_path, target, toolchain_name,
def build_library(src_paths, build_path, target, toolchain_name, def build_library(src_paths, build_path, target, toolchain_name,
dependencies_paths=None, options=None, name=None, clean=False, dependencies_paths=None, options=None, name=None, clean=False,
notify=None, verbose=False, macros=None, inc_dirs=None, jobs=1): notify=None, verbose=False, macros=None, inc_dirs=None, inc_dirs_ext=None, jobs=1):
""" src_path: the path of the source directory """ src_path: the path of the source directory
build_path: the path of the build directory build_path: the path of the build directory
target: ['LPC1768', 'LPC11U24', 'LPC2368'] target: ['LPC1768', 'LPC11U24', 'LPC2368']
@ -102,6 +102,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
notify: Notify function for logs notify: Notify function for logs
verbose: Write the actual tools command lines if True verbose: Write the actual tools command lines if True
inc_dirs: additional include directories which should be included in build inc_dirs: additional include directories which should be included in build
inc_dirs_ext: additional include directories which should be copied to library directory
""" """
if type(src_paths) != ListType: if type(src_paths) != ListType:
src_paths = [src_paths] src_paths = [src_paths]
@ -124,6 +125,11 @@ def build_library(src_paths, build_path, target, toolchain_name,
resources = [] resources = []
for src_path in src_paths: for src_path in src_paths:
resources.append(toolchain.scan_resources(src_path)) resources.append(toolchain.scan_resources(src_path))
# Add extra include directories / files which are required by library
# This files usually are not in the same directory as source files so
# previous scan will not include them
for inc_ext in inc_dirs_ext:
resources.append(toolchain.scan_resources(inc_ext))
# Dependencies Include Paths # Dependencies Include Paths
dependencies_include_dir = [] dependencies_include_dir = []
@ -171,6 +177,7 @@ def build_lib(lib_id, target, toolchain, options=None, verbose=False, clean=Fals
macros=MACROS, macros=MACROS,
notify=notify, notify=notify,
inc_dirs=lib.inc_dirs, inc_dirs=lib.inc_dirs,
inc_dirs_ext=lib.inc_dirs_ext,
jobs=jobs) jobs=jobs)
else: else:
print 'Library "%s" is not yet supported on target %s with toolchain %s' % (lib_id, target.name, toolchain) print 'Library "%s" is not yet supported on target %s with toolchain %s' % (lib_id, target.name, toolchain)

View File

@ -94,7 +94,7 @@ LIBRARIES = [
"build_dir": CPPUTEST_LIBRARY, "build_dir": CPPUTEST_LIBRARY,
"dependencies": [MBED_LIBRARIES], "dependencies": [MBED_LIBRARIES],
'inc_dirs': [CPPUTEST_INC, CPPUTEST_PLATFORM_INC, CPPUTEST_TESTRUNNER_INC, TEST_MBED_LIB], 'inc_dirs': [CPPUTEST_INC, CPPUTEST_PLATFORM_INC, CPPUTEST_TESTRUNNER_INC, TEST_MBED_LIB],
'inc_dirs_ext': [CPPUTEST_INC], 'inc_dirs_ext': [CPPUTEST_INC_EXT],
'macros': ["CPPUTEST_USE_MEM_LEAK_DETECTION=0", "CPPUTEST_USE_STD_CPP_LIB=0", "CPPUTEST=1"], 'macros': ["CPPUTEST_USE_MEM_LEAK_DETECTION=0", "CPPUTEST_USE_STD_CPP_LIB=0", "CPPUTEST=1"],
}, },
] ]

View File

@ -95,8 +95,9 @@ EXPORT_TMP = join(EXPORT_DIR, ".temp")
# CppUtest library # CppUtest library
CPPUTEST_DIR = join(ROOT, "..") CPPUTEST_DIR = join(ROOT, "..")
CPPUTEST_SRC = join(CPPUTEST_DIR, "cpputest", "src", "CppUTest") #, "CppUTest" CPPUTEST_SRC = join(CPPUTEST_DIR, "cpputest", "src", "CppUTest")
CPPUTEST_INC = join(CPPUTEST_DIR, "cpputest", "include") #, "CppUTest" CPPUTEST_INC = join(CPPUTEST_DIR, "cpputest", "include")
CPPUTEST_INC_EXT = join(CPPUTEST_DIR, "cpputest", "include", "CppUTest")
# Platform dependant code is here (for armcc compiler) # Platform dependant code is here (for armcc compiler)
CPPUTEST_PLATFORM_SRC = join(CPPUTEST_DIR, "cpputest", "src", "Platforms", "armcc") CPPUTEST_PLATFORM_SRC = join(CPPUTEST_DIR, "cpputest", "src", "Platforms", "armcc")
CPPUTEST_PLATFORM_INC = join(CPPUTEST_DIR, "cpputest", "include", "Platforms", "armcc") CPPUTEST_PLATFORM_INC = join(CPPUTEST_DIR, "cpputest", "include", "Platforms", "armcc")