# Copyright AllSeen Alliance. All rights reserved.
#
#    Permission to use, copy, modify, and/or distribute this software for any
#    purpose with or without fee is hereby granted, provided that the above
#    copyright notice and this permission notice appear in all copies.
#
#    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

import os

Import('env')

env['_ALLJOYN_NOTIFICATION_'] = True
env['OBJDIR_SERVICES_NOTIFICATION'] = env['OBJDIR'] + '/services/notification'

# Make config library and header file paths available to the global environment
env.Append(LIBPATH = '$DISTDIR/notification/lib');
env.Append(CPPPATH = '$DISTDIR/notification/inc');

if not env.has_key('_ALLJOYN_SERVICES_COMMON_') and os.path.exists('../services_common/SConscript'):
    env.SConscript('../services_common/SConscript')

nsenv = env.Clone()

# ASABASE-452, ASACORE-1419
# Even though we have deprecated the About Service code the notification service is
# designed so a developer can use the deprecated AboutService or the new
# About Feature code. So the notification service can continue to support the
# deprecated methods we must turn off the deprecated-declarations warning.
if nsenv['OS_GROUP'] == 'posix':
    nsenv.Append(CXXFLAGS = ['-Wno-deprecated-declarations'])

for b in nsenv['bindings']:
    if os.path.exists('%s/SConscript' % b):
        nsenv.VariantDir('$OBJDIR_SERVICES_NOTIFICATION/%s' % b, b, duplicate = 0)

nsenv.SConscript(['$OBJDIR_SERVICES_NOTIFICATION/%s/SConscript' % b for b in env['bindings'] if os.path.exists('%s/SConscript' % b) ],
                 exports = ['nsenv'])
