Commit d484ec77 authored by Dan Mihai's avatar Dan Mihai

[IOT-2012] Windows: rename ocpmapi.lib

Windows exports ocpmapi APIs from octbstack.dll. IoTivity sample apps
and apps outside IoTivity should link with import library octbstack.lib
rather than the static library ocpmapi.lib. To expose possible
incorrect linking with ocpmapi.lib, rename it to ocpmapi_internal.lib
on Windows.

Change-Id: Ieec1abc65651c3b69674acc7419c87f8ef50d3a4
Signed-off-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18777Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
parent 984bb16d
......@@ -109,16 +109,19 @@ else:
if target_os in ['android']:
provisioning_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libocpmapi.so'])
if target_os in ['windows', 'msys_nt', 'ios']:
# octbstack.dll is exporting ocpmapi APIs on Windows - there is no ocpmapi.dll.
provisioningserver = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
else:
static_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
shared_provisioning_lib = provisioning_env.SharedLibrary('ocpmapi', provisioning_src)
provisioningserver = Flatten([static_provisioning_lib, shared_provisioning_lib])
internal_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi_internal', provisioning_src)
provisioningserver = Flatten(internal_provisioning_lib)
if target_os not in ['windows', 'msys_nt']:
static_provisioning_lib = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(static_provisioning_lib)
if target_os not in ['ios']:
shared_provisioning_lib = provisioning_env.SharedLibrary('ocpmapi', provisioning_src)
provisioningserver += Flatten(shared_provisioning_lib)
provisioning_env.InstallTarget(provisioningserver, 'ocpmapi')
provisioning_env.UserInstallTargetLib(provisioningserver, 'ocpmapi')
if target_os in ['linux', 'msys_nt', 'windows', 'tizen']:
SConscript('sample/SConscript', 'provisioning_env')
SConscript('sample/SConscript', 'provisioning_env')
......@@ -61,7 +61,7 @@ sptest_env.PrependUnique(CPPPATH = [
'../../../connectivity/api'
])
sptest_env.PrependUnique(LIBS = [ 'ocpmapi',
sptest_env.PrependUnique(LIBS = [ 'ocpmapi_internal',
'oc',
'octbstack_test',
'ocsrm',
......@@ -81,7 +81,9 @@ if sptest_env.get('MULTIPLE_OWNER') == '1':
if target_os in ['msys_nt', 'windows']:
sptest_env.AppendUnique(LIBS = ['octbstack_static', 'sqlite3'])
else:
sptest_env.AppendUnique(LIBS = ['octbstack'])
sptest_env.AppendUnique(LIBS = ['octbstack'])
if target_os in ['linux', 'tizen']:
sptest_env.ParseConfig('pkg-config --cflags --libs sqlite3')
######################################################################
# Source files and Targets
......
......@@ -142,7 +142,7 @@ else:
else:
# On Windows, apps don't link directly with ocpmapi.lib. ocpmapi is linked
# inside octbstack.dll and apps import its APIs by linking with octbstack.lib.
liboctbstack_env.PrependUnique(LIBS = ['ocpmapi'])
liboctbstack_env.PrependUnique(LIBS = ['ocpmapi_internal'])
liboctbstack_env.Textfile(target = 'octbstack_temp3.def', source = [File('octbstack_temp2.def'), File('octbstack_product_secured.def')])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment