From 58d0861a0ee4e668ba508664532c97169eb1ae2b Mon Sep 17 00:00:00 2001 From: Justin Buchanan Date: Sun, 15 Nov 2015 03:52:54 -0500 Subject: [PATCH] added option to build rpc library. closes #1426 --- workspace_tools/build.py | 8 ++++++++ workspace_tools/libraries.py | 8 ++++++++ workspace_tools/make.py | 6 ++++++ workspace_tools/paths.py | 2 ++ 4 files changed, 24 insertions(+) diff --git a/workspace_tools/build.py b/workspace_tools/build.py index 969ca03b6b..640f2feb48 100755 --- a/workspace_tools/build.py +++ b/workspace_tools/build.py @@ -50,6 +50,12 @@ if __name__ == '__main__': default=False, help="Compile the rtos") + parser.add_option("--rpc", + action="store_true", + dest="rpc", + default=False, + help="Compile the rpc library") + parser.add_option("-e", "--eth", action="store_true", dest="eth", default=False, @@ -169,6 +175,8 @@ if __name__ == '__main__': # Additional Libraries if options.rtos: libraries.extend(["rtx", "rtos"]) + if options.rpc: + libraries.extend(["rpc"]) if options.eth: libraries.append("eth") if options.usb: diff --git a/workspace_tools/libraries.py b/workspace_tools/libraries.py index 954419a8f1..c4db6c8e79 100644 --- a/workspace_tools/libraries.py +++ b/workspace_tools/libraries.py @@ -34,6 +34,14 @@ LIBRARIES = [ "dependencies": [MBED_LIBRARIES, MBED_RTX], }, + # RPC + { + "id": "rpc", + "source_dir": MBED_RPC, + "build_dir": RPC_LIBRARY, + "dependencies": [MBED_LIBRARIES], + }, + # USB Device libraries { "id": "usb", diff --git a/workspace_tools/make.py b/workspace_tools/make.py index 828f3644ab..e4ade4cbbf 100755 --- a/workspace_tools/make.py +++ b/workspace_tools/make.py @@ -30,6 +30,7 @@ sys.path.insert(0, ROOT) from workspace_tools.utils import args_error from workspace_tools.paths import BUILD_DIR from workspace_tools.paths import RTOS_LIBRARIES +from workspace_tools.paths import RPC_LIBRARY from workspace_tools.paths import ETH_LIBRARY from workspace_tools.paths import USB_HOST_LIBRARIES, USB_LIBRARIES from workspace_tools.paths import DSP_LIBRARIES @@ -113,6 +114,10 @@ if __name__ == '__main__': action="store_true", dest="rtos", default=False, help="Link with RTOS library") + parser.add_option("--rpc", + action="store_true", dest="rpc", + default=False, help="Link with RPC library") + parser.add_option("--eth", action="store_true", dest="eth", default=False, @@ -218,6 +223,7 @@ if __name__ == '__main__': # Linking with extra libraries if options.rtos: test.dependencies.append(RTOS_LIBRARIES) + if options.rpc: test.dependencies.append(RPC_LIBRARY) if options.eth: test.dependencies.append(ETH_LIBRARY) if options.usb_host: test.dependencies.append(USB_HOST_LIBRARIES) if options.usb: test.dependencies.append(USB_LIBRARIES) diff --git a/workspace_tools/paths.py b/workspace_tools/paths.py index b2b92fecc6..ec9741a38d 100644 --- a/workspace_tools/paths.py +++ b/workspace_tools/paths.py @@ -47,6 +47,8 @@ HOST_TESTS = join(ROOT, "workspace_tools", "host_tests") # mbed RPC MBED_RPC = join(LIB_DIR, "rpc") +RPC_LIBRARY = join(BUILD_DIR, "rpc") + # mbed RTOS RTOS = join(LIB_DIR, "rtos") MBED_RTX = join(RTOS, "rtx")