From 068cf406da11cfe5d285281073fe3262c0789964 Mon Sep 17 00:00:00 2001 From: Abhishek Sharma Date: Tue, 21 Mar 2017 15:21:37 +0530 Subject: [PATCH] Proxy Service: Fix broken build. Fixed Proxy service build issues. Change-Id: Ib49bc0e9943d2e967a8373f170e3ecba3a237020 Signed-off-by: Abhishek Sharma Reviewed-on: https://gerrit.iotivity.org/gerrit/18045 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/coap-http-proxy/SConscript | 15 ++++++++------- service/coap-http-proxy/samples/SConscript | 3 ++- service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp | 3 +-- service/coap-http-proxy/unittests/SConscript | 9 ++++++++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/service/coap-http-proxy/SConscript b/service/coap-http-proxy/SConscript index 65419f6..687e2e9 100644 --- a/service/coap-http-proxy/SConscript +++ b/service/coap-http-proxy/SConscript @@ -29,10 +29,10 @@ if local_env.get('LOGGING'): local_env.AppendUnique(CPPDEFINES = ['-DTB_LOG']) if env.get('RELEASE'): - env.AppendUnique(CCFLAGS = ['-Os']) - env.AppendUnique(CPPDEFINES = ['NDEBUG']) + local_env.AppendUnique(CCFLAGS = ['-Os']) + local_env.AppendUnique(CPPDEFINES = ['NDEBUG']) else: - env.AppendUnique(CCFLAGS = ['-g']) + local_env.AppendUnique(CCFLAGS = ['-g']) target_os = env.get('TARGET_OS') src_dir = env.get('SRC_DIR') @@ -44,16 +44,17 @@ local_env.AppendUnique(CPPPATH = ['include', os.path.join(src_dir, 'resource/csdk/include'), os.path.join(src_dir, 'resource/csdk/stack/include'), os.path.join(src_dir, 'resource/csdk/connectivity/common/inc/'), + os.path.join(src_dir, 'resource/csdk/security/include'), os.path.join(src_dir, 'extlibs/cjson'), ]) -with_upstream_libcoap = env.get('WITH_UPSTREAM_LIBCOAP') +with_upstream_libcoap = local_env.get('WITH_UPSTREAM_LIBCOAP') if with_upstream_libcoap == '1': # For bring up purposes only, # we manually copy the forked version to where the unforked version is downloaded. - env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) + local_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include']) else: - env.AppendUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include']) + local_env.AppendUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include']) local_env.PrependUnique(LIBS = ['cjson', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap']) if target_os not in ['windows']: @@ -67,7 +68,7 @@ if target_os == 'android': local_env.AppendUnique(LIBS = ['gnustl_static']) if not env.get('RELEASE'): - rd_env.AppendUnique(LIBS = ['log']) + local_env.AppendUnique(LIBS = ['log']) ###################################################################### # Source files and Targets ###################################################################### diff --git a/service/coap-http-proxy/samples/SConscript b/service/coap-http-proxy/samples/SConscript index 977df73..ec0a71c 100644 --- a/service/coap-http-proxy/samples/SConscript +++ b/service/coap-http-proxy/samples/SConscript @@ -42,7 +42,8 @@ else: proxy_sample_app_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) proxy_sample_app_env.AppendUnique(RPATH = [env.get('BUILD_DIR')]) -proxy_sample_app_env.PrependUnique(LIBS = ['coap_http_proxy', 'oc', 'octbstack', 'curl', 'connectivity_abstraction']) +proxy_sample_app_env.PrependUnique(LIBS = ['coap_http_proxy', 'oc', 'octbstack', 'curl', 'connectivity_abstraction', 'cjson', 'm']) +proxy_sample_app_env.AppendUnique(CPPPATH = ['#resource/csdk/security/include']) if env.get('SECURED') == '1': proxy_sample_app_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto']) diff --git a/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp b/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp index a99e2e3..31662b3 100644 --- a/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp +++ b/service/coap-http-proxy/unittests/CoAPHttpUnitTest.cpp @@ -24,7 +24,6 @@ #include "oic_malloc.h" #include "oic_string.h" #include "logger.h" -#include "ocpayload.h" #include "uarraylist.h" #include "CoapHttpParser.h" #include "CoapHttpMap.h" @@ -40,7 +39,7 @@ typedef struct { OCMethod method; OCRequestHandle requestHandle; -}CHPRequest_t; +}CHPRequest_t; static int g_quitFlag = 0; static int g_secureFlag = 0; diff --git a/service/coap-http-proxy/unittests/SConscript b/service/coap-http-proxy/unittests/SConscript index 4adbac0..49ae835 100644 --- a/service/coap-http-proxy/unittests/SConscript +++ b/service/coap-http-proxy/unittests/SConscript @@ -53,7 +53,7 @@ target_os = CoAP_test_env.get('TARGET_OS') CoAP_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')]) CoAP_test_env.AppendUnique(LIBS = [ - 'coap_http_proxy','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap']) + 'coap_http_proxy','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'cjson']) if target_os not in ['windows']: CoAP_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0']) @@ -92,3 +92,10 @@ Alias("CoAP_unit_test", CoAP_unit_test) CoAP_test_env.AppendTarget('CoAP_unit_test') CoAP_test_env.InstallTarget(CoAP_unit_test, 'CoAP_unit_test') +if CoAP_test_env.get('TEST') == '1': + if target_os in ['linux']: + from tools.scons.RunTest import run_test + run_test(CoAP_test_env, + '', + 'service/coap-http-proxy/unittests/CoAP_unit_test', + CoAP_unit_test) -- 2.7.4