From 0ac08e1e076304d14934b7a6b8a1d92255ced43b Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Sat, 9 Jul 2016 19:31:09 +0200 Subject: [PATCH] Build: add gtest libs automatically Once gtest's sconfile is imported, build flags are propagated. Deeper cleanup and effort to make tests less linux specific by avoiding to add gtest's pthread dependencies in sub scons files. Bug: https://jira.iotivity.org/browse/IOT-863 Bug-AGL: https://jira.automotivelinux.org/browse/SPEC-158 Change-Id: I4ddbf3e1eef8648ceaeae6c62175308cb6f3fec1 Origin: https://github.com/tizenteam/iotivity/ Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/249 Tested-by: jenkins-iotivity Reviewed-by: David Antler Reviewed-by: Dave Thaler Reviewed-by: Jon A. Cruz --- build_common/linux/SConscript | 3 +-- extlibs/gtest/SConscript | 5 +++-- plugins/unittests/SConscript | 7 +------ resource/c_common/ocrandom/test/SConscript | 8 +------- resource/c_common/oic_malloc/test/SConscript | 5 +---- resource/c_common/oic_string/test/SConscript | 4 +--- resource/c_common/oic_time/test/SConscript | 3 --- resource/csdk/SConscript | 3 --- resource/csdk/connectivity/test/SConscript | 8 -------- .../csdk/security/provisioning/ck_manager/unittest/SConscript | 6 +----- resource/csdk/security/provisioning/unittest/SConscript | 7 +------ resource/csdk/security/unittest/SConscript | 7 +------ resource/csdk/stack/test/SConscript | 9 ++------- resource/provisioning/unittests/SConscript | 8 +------- resource/unittests/SConscript | 7 +------ service/easy-setup/enrollee/unittests/SConscript | 10 +++------- service/easy-setup/mediator/csdk/unittests/SConscript | 11 +---------- service/easy-setup/mediator/richsdk/unittests/SConscript | 11 +---------- service/resource-container/unittests/SConscript | 8 ++++---- service/resource-encapsulation/src/common/SConscript | 9 +-------- .../src/resourceBroker/unittest/SConscript | 5 ----- .../src/resourceCache/unittests/SConscript | 6 +----- service/resource-encapsulation/src/serverBuilder/SConscript | 9 +-------- service/resource-encapsulation/unittests/SConscript | 11 +---------- service/resource-hosting/unittest/SConscript | 9 ++------- service/scene-manager/unittests/SConscript | 9 ++------- service/things-manager/unittests/SConscript | 11 +---------- 27 files changed, 33 insertions(+), 166 deletions(-) diff --git a/build_common/linux/SConscript b/build_common/linux/SConscript index 2311520..679b231 100644 --- a/build_common/linux/SConscript +++ b/build_common/linux/SConscript @@ -19,8 +19,7 @@ if env.get('LOGGING'): env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__']) env.AppendUnique(CFLAGS = ['-std=gnu99']) env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC']) -env.AppendUnique(LIBS = ['dl', 'pthread']) -env.AppendUnique(LIBS = ['uuid']) +env.AppendUnique(LIBS = ['dl', 'uuid']) # Set arch flags that match best TARGET_ARCH variable target_arch = env.get('TARGET_ARCH') diff --git a/extlibs/gtest/SConscript b/extlibs/gtest/SConscript index b3c002f..d29c324 100644 --- a/extlibs/gtest/SConscript +++ b/extlibs/gtest/SConscript @@ -167,13 +167,14 @@ if target_os in targets_need_gtest: gtest_env.AppendUnique(LIBPATH = [gtest_dotlib_dir]) gtest_env.PrependUnique(CPPPATH = [os.path.join(gtest_dir, 'include')]) gtest_env.AppendENVPath('LD_LIBRARY_PATH', gtest_dotlib_dir) - compiler = gtest_env.get('CXX') - if 'g++' in compiler: + if 'g++' in gtest_env.get('CXX'): gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x']) gtest_env.AppendUnique(CXXFLAGS = ['-Wall']) # Note: 'pthread' for android is in bionic # On other platform, if use new gcc(>4.9?) it isn't required, otherwise, it's required if target_os not in ['android']: gtest_env.AppendUnique(CXXFLAGS = ['-pthread']) + gtest_env.PrependUnique(LIBS = ['pthread']) + gtest_env.PrependUnique(LIBS = ['gtest', 'gtest_main']) Return('gtest_env') diff --git a/plugins/unittests/SConscript b/plugins/unittests/SConscript index bd399d7..06b3e66 100644 --- a/plugins/unittests/SConscript +++ b/plugins/unittests/SConscript @@ -36,9 +36,6 @@ unittests_env.PrependUnique(CPPPATH = [ os.path.join(pi_dir, 'include'), ]) -if target_os not in ['windows']: - unittests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - unittests_env.PrependUnique(LIBS = ['pthread']) unittests_env.AppendUnique(LIBPATH = [unittests_env.get('BUILD_DIR')]) unittests_env.PrependUnique(LIBS = [ 'plugin_interface', @@ -46,9 +43,7 @@ unittests_env.PrependUnique(LIBS = [ 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main' + 'coap' ]) if unittests_env.get('LOGGING'): diff --git a/resource/c_common/ocrandom/test/SConscript b/resource/c_common/ocrandom/test/SConscript index c813d2f..6b73957 100644 --- a/resource/c_common/ocrandom/test/SConscript +++ b/resource/c_common/ocrandom/test/SConscript @@ -35,15 +35,9 @@ randomtest_env.PrependUnique(CPPPATH = [ '../../../oc_logger/include', ]) -if target_os not in ['windows']: - randomtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - randomtest_env.AppendUnique(LIBS = ['pthread']) - randomtest_env.AppendUnique(LIBPATH = [randomtest_env.get('BUILD_DIR')]) randomtest_env.PrependUnique(LIBS = ['octbstack', - 'uuid', - 'gtest', - 'gtest_main']) + 'uuid']) if target_os in ['linux']: randomtest_env.AppendUnique(LIBS = ['m']) diff --git a/resource/c_common/oic_malloc/test/SConscript b/resource/c_common/oic_malloc/test/SConscript index 89c6705..b1d9e2a 100644 --- a/resource/c_common/oic_malloc/test/SConscript +++ b/resource/c_common/oic_malloc/test/SConscript @@ -32,11 +32,8 @@ target_os = malloctest_env.get('TARGET_OS') malloctest_env.PrependUnique(CPPPATH = [ '../include']) -if target_os not in ['windows']: - malloctest_env.PrependUnique(LIBS = ['pthread']) - malloctest_env.AppendUnique(LIBPATH = [os.path.join(malloctest_env.get('BUILD_DIR'), 'resource', 'c_common')]) -malloctest_env.PrependUnique(LIBS = ['c_common', 'gtest', 'gtest_main']) +malloctest_env.PrependUnique(LIBS = ['c_common']) if malloctest_env.get('LOGGING'): malloctest_env.AppendUnique(CPPDEFINES = ['TB_LOG']) diff --git a/resource/c_common/oic_string/test/SConscript b/resource/c_common/oic_string/test/SConscript index 29f394a..94bbd2b 100644 --- a/resource/c_common/oic_string/test/SConscript +++ b/resource/c_common/oic_string/test/SConscript @@ -33,9 +33,7 @@ stringtest_env.PrependUnique(CPPPATH = ['../include']) stringtest_env.AppendUnique(LIBPATH = [os.path.join(stringtest_env.get('BUILD_DIR'), 'resource', 'c_common')]) stringtest_env.PrependUnique(LIBS = ['c_common']) -if target_os not in ['windows']: - stringtest_env.PrependUnique(LIBS = ['pthread']) -stringtest_env.PrependUnique(LIBS = ['gtest', 'gtest_main']) + if stringtest_env.get('LOGGING'): stringtest_env.AppendUnique(CPPDEFINES = ['TB_LOG']) # diff --git a/resource/c_common/oic_time/test/SConscript b/resource/c_common/oic_time/test/SConscript index 64d4021..c4cb46b 100644 --- a/resource/c_common/oic_time/test/SConscript +++ b/resource/c_common/oic_time/test/SConscript @@ -33,9 +33,6 @@ timetest_env.PrependUnique(CPPPATH = [ '../include']) timetest_env.AppendUnique(LIBPATH = [os.path.join(timetest_env.get('BUILD_DIR'), 'resource', 'c_common')]) -if target_os not in ['windows']: - timetest_env.PrependUnique(LIBS = ['pthread']) -timetest_env.PrependUnique(LIBS = ['gtest', 'gtest_main']) timetest_env.PrependUnique(LIBS = ['c_common']) timetest_env.Append(LIBS = ['rt']); diff --git a/resource/csdk/SConscript b/resource/csdk/SConscript index d4e3dd6..559eb95 100644 --- a/resource/csdk/SConscript +++ b/resource/csdk/SConscript @@ -91,9 +91,6 @@ else: if target_os in ['tizen', 'linux']: liboctbstack_env.ParseConfig("pkg-config --cflags --libs uuid") -if target_os not in ['android', 'arduino', 'windows', 'msys_nt']: - liboctbstack_env.AppendUnique(LIBS = ['pthread']) - if target_os == 'arduino': liboctbstack_env.AppendUnique(CPPDEFINES = ['NDEBUG', 'WITH_ARDUINO']) elif target_os not in ['darwin','ios', 'msys_nt', 'windows']: diff --git a/resource/csdk/connectivity/test/SConscript b/resource/csdk/connectivity/test/SConscript index 9177c4a..0184c38 100644 --- a/resource/csdk/connectivity/test/SConscript +++ b/resource/csdk/connectivity/test/SConscript @@ -37,13 +37,6 @@ catest_env.PrependUnique(CPPPATH = [ '../../../oc_logger/include', ]) -tmplist = catest_env['LINKFLAGS'][:] -if '-lpthread' in tmplist: - tmplist.remove('-lpthread') - catest_env.Replace(LINKFLAGS = tmplist) - -if target_os not in ['windows']: - catest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) catest_env.AppendUnique(LIBPATH = [catest_env.get('BUILD_DIR')]) catest_env.PrependUnique(LIBS = ['gtest', 'gtest_main']) catest_env.PrependUnique(LIBS = ['octbstack', @@ -70,7 +63,6 @@ if target_os in ['msys_nt', 'windows']: 'iphlpapi']) else: catest_env.AppendUnique(LIBS = ['m']) - catest_env.PrependUnique(LIBS = ['pthread']) ###################################################################### # Source files and Targets diff --git a/resource/csdk/security/provisioning/ck_manager/unittest/SConscript b/resource/csdk/security/provisioning/ck_manager/unittest/SConscript index ea6166b..88f33de 100644 --- a/resource/csdk/security/provisioning/ck_manager/unittest/SConscript +++ b/resource/csdk/security/provisioning/ck_manager/unittest/SConscript @@ -47,16 +47,12 @@ pki_test_env.PrependUnique(CPPPATH = ['../include/', '../../../../../../extlibs/tinydtls/ecc', '../../../../../../extlibs/tinydtls/sha2' ]) -if target_os not in ['windows']: - pki_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - pki_test_env.AppendUnique(LIBS = ['pthread']) + pki_test_env.AppendUnique(LIBPATH = [pki_test_env.get('BUILD_DIR')]) pki_test_env.AppendUnique(LIBS = ['octbstack']) pki_test_env.AppendUnique(LIBS = ['CKManager']) pki_test_env.AppendUnique(LIBS = ['asn1']) -pki_test_env.AppendUnique(LIBS = ['gtest']) -pki_test_env.AppendUnique(LIBS = ['gtest_main']) if pki_test_env.get('SECURED') == '1': pki_test_env.AppendUnique(LIBS = ['tinydtls']) diff --git a/resource/csdk/security/provisioning/unittest/SConscript b/resource/csdk/security/provisioning/unittest/SConscript index 107ece6..cbc72fb 100644 --- a/resource/csdk/security/provisioning/unittest/SConscript +++ b/resource/csdk/security/provisioning/unittest/SConscript @@ -59,9 +59,7 @@ sptest_env.PrependUnique(LIBS = [ 'ocpmapi', 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main']) + 'coap']) if sptest_env.get('SECURED') == '1': sptest_env.AppendUnique(LIBS = ['timer']) @@ -79,9 +77,6 @@ if target_os in ['msys_nt', 'windows']: sptest_env.AppendUnique(LIBS = ['ws2_32', 'advapi32', 'iphlpapi']) -else: - sptest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - sptest_env.AppendUnique(LIBS = ['dl', 'pthread']) ###################################################################### # Source files and Targets diff --git a/resource/csdk/security/unittest/SConscript b/resource/csdk/security/unittest/SConscript index f8e7976..2f273cb 100644 --- a/resource/csdk/security/unittest/SConscript +++ b/resource/csdk/security/unittest/SConscript @@ -46,17 +46,12 @@ srmtest_env.PrependUnique(CPPPATH = [ '../include' ]) -if target_os not in ['windows']: - srmtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - srmtest_env.AppendUnique(LIBS = ['pthread']) srmtest_env.AppendUnique(LIBPATH = [srmtest_env.get('BUILD_DIR')]) srmtest_env.PrependUnique(LIBS = ['ocsrm', 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main']) + 'coap']) if srmtest_env.get('SECURED') == '1': srmtest_env.AppendUnique(LIBS = ['tinydtls', 'timer']) diff --git a/resource/csdk/stack/test/SConscript b/resource/csdk/stack/test/SConscript index cf6f095..e759fe8 100644 --- a/resource/csdk/stack/test/SConscript +++ b/resource/csdk/stack/test/SConscript @@ -41,16 +41,12 @@ stacktest_env.PrependUnique(CPPPATH = [ '../../extlibs/cjson', '../../../oc_logger/include', ]) -if target_os not in ['windows']: - stacktest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) + stacktest_env.AppendUnique(LIBPATH = [stacktest_env.get('BUILD_DIR')]) stacktest_env.PrependUnique(LIBS = ['octbstack', 'ocsrm', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main']) - + 'coap']) if target_os != 'darwin': stacktest_env.PrependUnique(LIBS = ['oc_logger']) @@ -65,7 +61,6 @@ if target_os in ['msys_nt', 'windows']: stacktest_env.AppendUnique(LIBS = ['ws2_32', 'iphlpapi', 'kernel32']) else: stacktest_env.PrependUnique(LIBS = ['m']) - stacktest_env.PrependUnique(LIBS = ['pthread']) ###################################################################### # Source files and Targets diff --git a/resource/provisioning/unittests/SConscript b/resource/provisioning/unittests/SConscript index bca6b5e..5e335a1 100755 --- a/resource/provisioning/unittests/SConscript +++ b/resource/provisioning/unittests/SConscript @@ -50,10 +50,6 @@ provisiontests_env.PrependUnique(CPPPATH = [ '../../../extlibs/hippomocks-master/HippoMocksTest' ]) -if target_os not in ['windows']: - provisiontests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - provisiontests_env.AppendUnique(LIBS = ['-lpthread', '-ldl']) - provisiontests_env.AppendUnique(LIBPATH = [provisiontests_env.get('BUILD_DIR')]) provisiontests_env.PrependUnique(LIBS = [ 'ocprovision', @@ -62,9 +58,7 @@ provisiontests_env.PrependUnique(LIBS = [ 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main', + 'coap' ]) if with_ra_ibb: diff --git a/resource/unittests/SConscript b/resource/unittests/SConscript index a2d2b4b..8d1249d 100644 --- a/resource/unittests/SConscript +++ b/resource/unittests/SConscript @@ -45,18 +45,13 @@ unittests_env.PrependUnique(CPPPATH = [ '#extlibs/hippomocks-master/HippoMocksTest' ]) -if target_os not in ['windows']: - unittests_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - unittests_env.AppendUnique(LIBS = ['pthread']) unittests_env.AppendUnique(LIBPATH = [unittests_env.get('BUILD_DIR')]) unittests_env.PrependUnique(LIBS = [ 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main' + 'coap' ]) if unittests_env.get('SECURED') == '1': diff --git a/service/easy-setup/enrollee/unittests/SConscript b/service/easy-setup/enrollee/unittests/SConscript index 4e545cb..009f3f1 100644 --- a/service/easy-setup/enrollee/unittests/SConscript +++ b/service/easy-setup/enrollee/unittests/SConscript @@ -49,17 +49,13 @@ enrollee_test_env.PrependUnique(CPPPATH = [ enrollee_test_env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc', enrollee_test_env.get('SRC_DIR') + '/service/easy-setup/enrollee/src']) -if target_os not in ['windows']: - enrollee_test_env.PrependUnique(LIBS = ['m']) - enrollee_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread']) - enrollee_test_env.AppendUnique(LIBS = ['pthread']) enrollee_test_env.AppendUnique(LIBPATH = [enrollee_test_env.get('BUILD_DIR')]) enrollee_test_env.PrependUnique(LIBS = [ 'octbstack', 'ocsrm', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main']) + 'coap']) +if target_os not in ['windows']: + enrollee_test_env.AppendUnique(LIBS = ['m']) if target_os != 'darwin': enrollee_test_env.PrependUnique(LIBS = ['oc_logger']) diff --git a/service/easy-setup/mediator/csdk/unittests/SConscript b/service/easy-setup/mediator/csdk/unittests/SConscript index f7c0ff1..9ac9032 100644 --- a/service/easy-setup/mediator/csdk/unittests/SConscript +++ b/service/easy-setup/mediator/csdk/unittests/SConscript @@ -63,22 +63,13 @@ mediator_csdk_test_env.AppendUnique( '../../../inc', ]) -if target_os not in ['windows']: - mediator_csdk_test_env.AppendUnique(LIBS = ['dl']) - mediator_csdk_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os != 'android': - mediator_csdk_test_env.AppendUnique(CXXFLAGS = ['-pthread']) - mediator_csdk_test_env.AppendUnique(LIBS = ['pthread']) - mediator_csdk_test_env.PrependUnique(LIBS = [ 'ESMediatorCSDK', 'oc', 'octbstack', 'oc_logger', 'oc_logger_core', - 'connectivity_abstraction', - 'gtest', - 'gtest_main']) + 'connectivity_abstraction']) ###################################################################### # Build Test diff --git a/service/easy-setup/mediator/richsdk/unittests/SConscript b/service/easy-setup/mediator/richsdk/unittests/SConscript index 51fe87f..5cd4985 100644 --- a/service/easy-setup/mediator/richsdk/unittests/SConscript +++ b/service/easy-setup/mediator/richsdk/unittests/SConscript @@ -63,13 +63,6 @@ mediator_rich_test_env.AppendUnique( '../../../inc', ]) -if target_os not in ['windows']: - mediator_rich_test_env.AppendUnique(LIBS = ['dl']) - mediator_rich_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os not in ['android']: - mediator_rich_test_env.AppendUnique(CXXFLAGS = ['-pthread']) - mediator_rich_test_env.AppendUnique(LIBS = ['pthread']) - if mediator_rich_test_env.get('SECURED') == '1': mediator_rich_test_env.PrependUnique(LIBS = ['tinydtls','ocprovision', 'ocpmapi', 'timer']) @@ -77,9 +70,7 @@ mediator_rich_test_env.PrependUnique(LIBS = [ 'ESMediatorRich', 'oc', 'octbstack', - 'oc_logger', - 'gtest', - 'gtest_main']) + 'oc_logger']) ###################################################################### # Build Test diff --git a/service/resource-container/unittests/SConscript b/service/resource-container/unittests/SConscript index 2306de5..56bc48c 100644 --- a/service/resource-container/unittests/SConscript +++ b/service/resource-container/unittests/SConscript @@ -105,11 +105,11 @@ if int(containerJavaSupport): if target_os not in ['windows']: container_gtest_env.AppendUnique(LIBS = ['dl']) - container_gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) container_gtest_env.AppendUnique(CCFLAGS = ['-Wnoexcept']) - if target_os != 'android': - container_gtest_env.AppendUnique(CXXFLAGS = ['-pthread']) - container_gtest_env.AppendUnique(LIBS = ['pthread']) + +container_gtest_env.PrependUnique(LIBS = ['rcs_container', 'rcs_client', 'rcs_server', 'rcs_common', + 'oc','octbstack', 'oc_logger', 'oc_logger_core', + 'connectivity_abstraction']) if target_os in ['android']: container_gtest_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) diff --git a/service/resource-encapsulation/src/common/SConscript b/service/resource-encapsulation/src/common/SConscript index 3ae199f..54d2a86 100644 --- a/service/resource-encapsulation/src/common/SConscript +++ b/service/resource-encapsulation/src/common/SConscript @@ -50,9 +50,6 @@ rcs_common_env.AppendUnique(LIBPATH = [rcs_common_env.get('BUILD_DIR')]) if target_os not in ['windows']: rcs_common_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os not in ['android']: - rcs_common_env.AppendUnique(CXXFLAGS = ['-pthread']) - rcs_common_env.AppendUnique(LIBS = ['pthread']) if target_os not in ['darwin', 'ios', 'windows']: rcs_common_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) @@ -105,11 +102,7 @@ if target_os in ['linux']: 'oc_logger', 'connectivity_abstraction', 'coap', - 'rcs_common', - 'gtest', - 'gtest_main', - 'pthread' - ]) + 'rcs_common']) rcs_common_test_src = [ rcs_common_test_env.Glob('primitiveResource/unittests/*.cpp'), diff --git a/service/resource-encapsulation/src/resourceBroker/unittest/SConscript b/service/resource-encapsulation/src/resourceBroker/unittest/SConscript index c324708..77f3f6d 100644 --- a/service/resource-encapsulation/src/resourceBroker/unittest/SConscript +++ b/service/resource-encapsulation/src/resourceBroker/unittest/SConscript @@ -64,16 +64,11 @@ broker_test_env.AppendUnique(LIBS = ['octbstack']) broker_test_env.AppendUnique(LIBS = ['oc']) broker_test_env.AppendUnique(LIBS = ['rcs_client']) broker_test_env.AppendUnique(LIBS = ['rcs_common']) -broker_test_env.AppendUnique(LIBS = ['gtest']) -broker_test_env.AppendUnique(LIBS = ['gtest_main']) compiler = broker_test_env.get('CXX') if 'g++' in compiler: broker_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) -if target_os not in ['windows']: - broker_test_env.AppendUnique(LIBS = ['pthread']) - ###################################################################### # Build Test ###################################################################### diff --git a/service/resource-encapsulation/src/resourceCache/unittests/SConscript b/service/resource-encapsulation/src/resourceCache/unittests/SConscript index b3ff5ae..6aecb48 100644 --- a/service/resource-encapsulation/src/resourceCache/unittests/SConscript +++ b/service/resource-encapsulation/src/resourceCache/unittests/SConscript @@ -56,16 +56,12 @@ cache_test_env.PrependUnique(CPPPATH = [cache_test_env.get('SRC_DIR')+'/extlibs/ cache_test_env.AppendUnique(LIBPATH = [cache_test_env.get('BUILD_DIR')]) cache_test_env.PrependUnique(LIBS = ['rcs_client', 'rcs_common', 'oc', 'octbstack', 'oc_logger', - 'connectivity_abstraction', 'coap', - 'gtest', 'gtest_main']) + 'connectivity_abstraction', 'coap']) compiler = cache_test_env.get('CXX') if 'g++' in compiler: cache_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) -if target_os not in ['windows']: - cache_test_env.AppendUnique(LIBS = ['pthread']) - ###################################################################### # Build Test ###################################################################### diff --git a/service/resource-encapsulation/src/serverBuilder/SConscript b/service/resource-encapsulation/src/serverBuilder/SConscript index f78a299..db158a4 100644 --- a/service/resource-encapsulation/src/serverBuilder/SConscript +++ b/service/resource-encapsulation/src/serverBuilder/SConscript @@ -56,9 +56,6 @@ if not release: server_builder_env.PrependUnique(LIBS = ['gcov']) if target_os not in ['windows']: server_builder_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os not in ['android']: - server_builder_env.AppendUnique(LIBS = ['dl']) - server_builder_env.AppendUnique(CXXFLAGS = ['-pthread']) if target_os not in ['darwin', 'ios', 'windows']: server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined']) @@ -94,11 +91,7 @@ if target_os in ['linux']: 'octbstack', 'oc_logger', 'connectivity_abstraction', - 'coap', - 'gtest', - 'gtest_main', - 'pthread', - ]) + 'coap']) server_builder_test_src = server_builder_test_env.Glob('unittests/*.cpp') diff --git a/service/resource-encapsulation/unittests/SConscript b/service/resource-encapsulation/unittests/SConscript index 7c31688..828d724 100644 --- a/service/resource-encapsulation/unittests/SConscript +++ b/service/resource-encapsulation/unittests/SConscript @@ -60,13 +60,6 @@ rcs_test_env.AppendUnique( '../src/common/utils/include', ]) -if target_os not in ['windows']: - rcs_test_env.AppendUnique(LIBS = ['dl']) - rcs_test_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os != 'android': - rcs_test_env.AppendUnique(CXXFLAGS = ['-pthread']) - rcs_test_env.AppendUnique(LIBS = ['pthread']) - rcs_test_env.PrependUnique(LIBS = [ 'connectivity_abstraction', 'oc_logger', @@ -75,9 +68,7 @@ rcs_test_env.PrependUnique(LIBS = [ 'oc', 'rcs_client', 'rcs_server', - 'rcs_common', - 'gtest', - 'gtest_main']) + 'rcs_common']) ###################################################################### # Build Test diff --git a/service/resource-hosting/unittest/SConscript b/service/resource-hosting/unittest/SConscript index 1dda7e2..848e94c 100644 --- a/service/resource-hosting/unittest/SConscript +++ b/service/resource-hosting/unittest/SConscript @@ -52,15 +52,10 @@ target_os = hosting_test_env.get('TARGET_OS') hosting_test_env.AppendUnique(LIBPATH = [hosting_test_env.get('BUILD_DIR')]) hosting_test_env.AppendUnique(LIBS = [ 'resource_hosting', 'rcs_server', 'rcs_client','rcs_common', - 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', - 'gtest_main', 'gtest']) + 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap']) if target_os not in ['windows']: - hosting_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) - -if target_os in ['linux']: - hosting_test_env.AppendUnique(CXXFLAGS = ['-pthread']) - hosting_test_env.AppendUnique(LIBS = ['pthread']) + hosting_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0']) hosting_test_env.PrependUnique(CPPPATH = [ src_dir + '/extlibs/hippomocks-master']) hosting_test_env.AppendUnique(CPPPATH = ['../src']) diff --git a/service/scene-manager/unittests/SConscript b/service/scene-manager/unittests/SConscript index 65d05c3..8924308 100755 --- a/service/scene-manager/unittests/SConscript +++ b/service/scene-manager/unittests/SConscript @@ -51,15 +51,10 @@ target_os = scene_test_env.get('TARGET_OS') scene_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')]) scene_test_env.AppendUnique(LIBS = [ 'scene_manager', 'rcs_server', 'rcs_client','rcs_common', - 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', - 'gtest_main', 'gtest']) + 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap']) if target_os not in ['windows']: - scene_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x']) - -if target_os in ['linux']: - scene_test_env.AppendUnique(CXXFLAGS = ['-pthread']) - scene_test_env.AppendUnique(LIBS = ['pthread']) + scene_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0']) if not scene_test_env.get('RELEASE'): scene_test_env.PrependUnique(LIBS = ['gcov']) diff --git a/service/things-manager/unittests/SConscript b/service/things-manager/unittests/SConscript index 379dfe3..97afc79 100644 --- a/service/things-manager/unittests/SConscript +++ b/service/things-manager/unittests/SConscript @@ -62,13 +62,6 @@ ThingsManager_gtest_env.AppendUnique( '../../../extlibs/timer' ]) -if target_os not in ['windows']: - ThingsManager_gtest_env.AppendUnique(LIBS = ['dl']) - ThingsManager_gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) - if target_os != 'android': - ThingsManager_gtest_env.AppendUnique(CXXFLAGS = ['-pthread']) - ThingsManager_gtest_env.AppendUnique(LIBS = ['pthread']) - ThingsManager_gtest_env.PrependUnique(LIBS = [ 'libTGMSDKLibrary', 'coap', @@ -76,9 +69,7 @@ ThingsManager_gtest_env.PrependUnique(LIBS = [ 'oc_logger', 'oc_logger_core', 'oc', - 'octbstack', - 'gtest', - 'gtest_main']) + 'octbstack']) ###################################################################### # Build Test -- 2.7.4