Import('env')
import os
+target_os = env.get('TARGET_OS')
+
+# Add platform-specific helper library
+if target_os in ['windows', 'msys_nt']:
+ SConscript('windows/SConscript')
+
env.AppendUnique(CPPPATH = [
- os.path.join(Dir('.').abspath, 'oic_malloc/include'),
- os.path.join(Dir('.').abspath, 'oic_string/include')
+ os.path.join(Dir('.').abspath),
+ os.path.join(Dir('.').abspath, 'oic_malloc', 'include'),
+ os.path.join(Dir('.').abspath, 'oic_string', 'include'),
+ os.path.join(Dir('.').abspath, 'oic_time', 'include'),
+ os.path.join(Dir('.').abspath, 'ocrandom', 'include')
])
-if env.get('TARGET_OS') == 'tizen':
+if target_os == 'tizen':
env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
else:
- env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource/c_common')])
+ env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', 'c_common')])
-env.AppendUnique(LIBS = ['c_common'])
+if target_os in ['tizen', 'linux']:
+ env.ParseConfig("pkg-config --cflags --libs uuid")
common_env = env.Clone()
+common_env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource')])
######################################################################
# Build flags
######################################################################
+common_conf = Configure(common_env)
+if common_conf.CheckFunc('QueryPerformanceFrequency'):
+ common_env.AppendUnique(CPPDEFINES = ['HAVE_QUERYPERFORMANCEFREQUENCY'])
+common_env = common_conf.Finish()
######################################################################
# Source files and Targets
######################################################################
common_src = [
- 'oic_string/src/oic_string.c',
- 'oic_malloc/src/oic_malloc.c'
- ]
+ 'oic_string/src/oic_string.c',
+ 'oic_malloc/src/oic_malloc.c',
+ 'oic_time/src/oic_time.c',
+ 'ocrandom/src/ocrandom.c',
+ ]
commonlib = common_env.StaticLibrary('c_common', common_src)
common_env.InstallTarget(commonlib, 'c_common')
common_env.UserInstallTargetLib(commonlib, 'c_common')
+common_env.UserInstallTargetHeader('platform_features.h', 'resource', 'platform_features.h')
+
+env.PrependUnique(LIBS = ['c_common'])