Import('*')

if env['TARGET_ISA'] == 'no':
    Return()

env.Prepend(CPPPATH=Dir('${PROJECT_SOURCE_DIR}/src/core/'))
env.Prepend(CPPPATH=Dir('${PROJECT_BINARY_DIR}/src/core/'))

env.Append(CXXFLAGS = '-Wno-deprecated')

env.Prepend(LIBPATH=Dir('${LIBRARY_OUTPUT_PATH}'))
gStaticLibs = [${additional_libs} '-lfail-sal',  '-lfail-comm', '-lfail-cpn', '-lfail-efw', '-lfail-util', '-lpcl', '-lprotobuf', '-liberty']

if (len(gStaticLibs)>0):
	linkFlags = ['-Wl,--start-group']
	linkFlags = linkFlags+gStaticLibs
	linkFlags = linkFlags+['-Wl,--end-group']

	env['GEN_LIB_BUILD_STATIC'] = linkFlags

	env.Append(SHLINKCOM = ' $GEN_LIB_BUILD_STATIC')
	env.Append(LINKCOM = ' $GEN_LIB_BUILD_STATIC')


DebugFlag('FailState')
CompoundFlag('Fail', ['FailState'])

Source(${GEM5_SAL_SRCS})
