# //******************************************************************
# //
# // Copyright 2015 Samsung Electronics 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')

tools_env = env.Clone()
src_dir = tools_env.get('SRC_DIR')

######################################################################
# Build flags
######################################################################
tools_env.PrependUnique(CPPPATH = ['../../../../extlibs/cjson',
                                  '../../stack/include',
                                  '../../stack/include/internal',
                                  '../../logger/include',
                                  '../../../oc_logger/include',
                                  '../../connectivity/api',
                                  '../include',
                                  '../include/internal',
                                  '../../connectivity/lib/libcoap-4.1.1',

                                  ])
tools_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
tools_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
tools_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
tools_env.PrependUnique(LIBS = ['oc', 'octbstack'])

######################################################################
# Source files and Targets
######################################################################
json2cbor = tools_env.Program('json2cbor', ['json2cbor.c'])
Alias("json2cbor", [json2cbor])
env.AppendTarget('json2cbor')
