#######################################################
#	Build BT EDR adapter
#######################################################

Import('connectivity_env')
import os

print "Reading BT EDR adapter script"

target_os = connectivity_env.get('TARGET_OS')
src_dir = os.path.abspath(os.curdir)

# Source files to build common for all platforms
if target_os != 'arduino':
    connectivity_env.AppendUnique(CA_SRC = [os.path.join(src_dir, 'caedradapter.c')])

# Check for the existence of the platform-specific SConscript file
# relative to the top-level source directory, not the build (variant)
# directory, before calling that SConscript file to prevent a missing
# file warning for platforms that don't provide one.
target_sconscript = target_os + '/SConscript'
if os.path.exists(target_sconscript):
    SConscript(target_sconscript, exports='connectivity_env')
