Minor SConscript clean-up
authorDan Mihai <Daniel.Mihai@microsoft.com>
Wed, 19 Apr 2017 05:34:43 +0000 (22:34 -0700)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Mon, 24 Apr 2017 18:30:32 +0000 (18:30 +0000)
Reduce the redundancy between the sets of LIBS for Darwin and
Windows, in preparation for more significant changes.

Change-Id: I4aaed0527e62857127058c3b09e91da816c3f1c4
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19111
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
resource/csdk/security/tool/SConscript

index 8c0289a..756ec96 100644 (file)
@@ -54,15 +54,20 @@ if target_os in ['windows', 'msys_nt']:
     # Macro needed for Windows builds to avoid __declspec(dllexport) and __declspec(dllimport) for cJSON APIs.
     tools_env.AppendUnique(CPPDEFINES = ['CJSON_HIDE_SYMBOLS'])
 
-if target_os in ['msys_nt', 'windows']:
-    # octbstack.dll doesn't export all the functions called by this app, so use static LIBs instead.
-    tools_env.AppendUnique(LIBS = ['coap', 'mbedtls', 'mbedx509', 'mbedcrypto',
-                                   'octbstack_static', 'ocsrm', 'connectivity_abstraction', 'sqlite3'])
-elif target_os in ['darwin']:
-    tools_env.AppendUnique(LIBS = ['coap', 'mbedtls', 'mbedx509', 'mbedcrypto',
-                                   'octbstack', 'ocsrm', 'connectivity_abstraction'])
-else:
+if target_os not in ['darwin', 'msys_nt', 'windows']:
     tools_env.PrependUnique(LIBS = ['octbstack', 'ocsrm', 'm'])
+else:
+    if target_os in ['darwin']:
+        tools_env.AppendUnique(LIBS = ['octbstack'])
+    else:
+        # This IoTivity-internal app calls non-Public APIs, so link with LIBS intended
+        # for IoTivity-internal tests (such as octbstack_static).
+        tools_env.AppendUnique(LIBS = ['octbstack_static'])
+        if target_os in ['windows']:
+            tools_env.AppendUnique(LIBS = ['sqlite3'])
+    tools_env.AppendUnique(LIBS = ['coap', 'mbedtls', 'mbedx509', 'mbedcrypto',
+                                   'ocsrm', 'connectivity_abstraction'])
+
 
 tools_env.PrependUnique(LIBS = ['cjson'])