#****************************************************************** # # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 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), 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 target_os == 'tizen': env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')]) else: env.AppendUnique(LIBPATH = [os.path.join(env.get('BUILD_DIR'), 'resource', '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_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'])