# Copyright (C) 2018 LongSung Technologies Limited and/or its affiliates("LongSung"). # All rights reserved. # # This software is supplied "AS IS" without any warranties. # LongSung assumes no responsibility or liability for the use of the software, # conveys no license or title under any patent, copyright, or mask work # right to the product. LongSung reserves the right to make changes in the # software without notification. LongSung also make no representation or # warranty that such application will be suitable for the specified use # without further testing or modification. cmake_minimum_required(VERSION 3.13) set(app_dir ./app) option(ENABLE_TEST_FLASH "使能SPI FLASH测试" OFF) option(ENABLE_ENABLE_AMRNB "使能AMRNB作为学习编解码" OFF) option(ENABLE_ENABLE_SPEEX "使能SPEEX作为学习编解码" ON) #add_definitions(-D ENABLE_OPENHPOC) if(ENABLE_TEST_FLASH) set(spi_files ./flashInterface/spiFlash.c ./flashInterface/spiFlashFat.c) include_directories(./flashInterface) endif(ENABLE_TEST_FLASH) #add speex if(ENABLE_ENABLE_SPEEX) add_definitions(-D ENABLE_ENABLE_SPEEX) set(speex_h_dir ./app/speex) endif(ENABLE_ENABLE_SPEEX) #add amrnb if(ENABLE_ENABLE_AMRNB) add_definitions(-D ENABLE_ENABLE_AMRNB) set(amrnb_dir ./app/amrnb) set(amrnb_files ${amrnb_dir}/agc.c ${amrnb_dir}/autocorr.c ${amrnb_dir}/az_lsp.c ${amrnb_dir}/bits2prm.c ${amrnb_dir}/cl_ltp.c ${amrnb_dir}/convolve.c ${amrnb_dir}/c1035pf.c ${amrnb_dir}/d_plsf.c ${amrnb_dir}/d_plsf_5.c ${amrnb_dir}/d_gain_c.c ${amrnb_dir}/d_gain_p.c ${amrnb_dir}/dec_lag6.c ${amrnb_dir}/d1035pf.c ${amrnb_dir}/cor_h.c ${amrnb_dir}/enc_lag3.c ${amrnb_dir}/enc_lag6.c ${amrnb_dir}/g_code.c ${amrnb_dir}/g_pitch.c ${amrnb_dir}/int_lpc.c ${amrnb_dir}/inter_36.c ${amrnb_dir}/inv_sqrt_ex.c ${amrnb_dir}/lag_wind.c ${amrnb_dir}/levinson.c ${amrnb_dir}/lsp_az.c ${amrnb_dir}/lsp_lsf.c ${amrnb_dir}/ol_ltp.c ${amrnb_dir}/pitch_fr.c ${amrnb_dir}/pitch_ol.c ${amrnb_dir}/pow2.c ${amrnb_dir}/pre_big.c ${amrnb_dir}/pre_proc.c ${amrnb_dir}/pred_lt.c ${amrnb_dir}/preemph.c ${amrnb_dir}/prm2bits.c ${amrnb_dir}/pstfilt.c ${amrnb_dir}/q_gain_c.c ${amrnb_dir}/q_gain_p.c ${amrnb_dir}/q_plsf.c ${amrnb_dir}/q_plsf_5.c ${amrnb_dir}/lsfwt.c ${amrnb_dir}/reorder.c ${amrnb_dir}/residu.c ${amrnb_dir}/lsp.c ${amrnb_dir}/lpc.c ${amrnb_dir}/ec_gains.c ${amrnb_dir}/spreproc.c ${amrnb_dir}/syn_filt.c ${amrnb_dir}/weight_a.c ${amrnb_dir}/qua_gain.c ${amrnb_dir}/gc_pred.c ${amrnb_dir}/q_plsf_3.c ${amrnb_dir}/post_pro.c ${amrnb_dir}/dec_lag3.c ${amrnb_dir}/dec_gain.c ${amrnb_dir}/d_plsf_3.c ${amrnb_dir}/d4_17pf.c ${amrnb_dir}/c4_17pf.c ${amrnb_dir}/d3_14pf.c ${amrnb_dir}/c3_14pf.c ${amrnb_dir}/d2_11pf.c ${amrnb_dir}/c2_11pf.c ${amrnb_dir}/d2_9pf.c ${amrnb_dir}/c2_9pf.c ${amrnb_dir}/cbsearch.c ${amrnb_dir}/spstproc.c ${amrnb_dir}/gain_q.c ${amrnb_dir}/cod_amr.c ${amrnb_dir}/dec_amr.c ${amrnb_dir}/sp_enc.c ${amrnb_dir}/sp_dec.c ${amrnb_dir}/ph_disp.c ${amrnb_dir}/g_adapt.c ${amrnb_dir}/calc_en.c ${amrnb_dir}/qgain795.c ${amrnb_dir}/qgain475.c ${amrnb_dir}/sqrt_l.c ${amrnb_dir}/set_sign.c ${amrnb_dir}/s10_8pf.c ${amrnb_dir}/bgnscd.c ${amrnb_dir}/gmed_n.c ${amrnb_dir}/mac_32.c ${amrnb_dir}/ex_ctrl.c ${amrnb_dir}/c_g_aver.c ${amrnb_dir}/lsp_avg.c ${amrnb_dir}/int_lsf.c ${amrnb_dir}/c8_31pf.c ${amrnb_dir}/d8_31pf.c ${amrnb_dir}/p_ol_wgh.c ${amrnb_dir}/ton_stab.c ${amrnb_dir}/vad1.c ${amrnb_dir}/dtx_enc.c ${amrnb_dir}/dtx_dec.c ${amrnb_dir}/a_refl.c ${amrnb_dir}/b_cn_cod.c ${amrnb_dir}/calc_cor.c ${amrnb_dir}/hp_max.c ${amrnb_dir}/vadname.c ${amrnb_dir}/vad2.c ${amrnb_dir}/r_fft_ex.c ${amrnb_dir}/lflg_upd.c ${amrnb_dir}/e_homing.c ${amrnb_dir}/d_homing.c ${amrnb_dir}/sid_sync.c ${amrnb_dir}/count.c ${amrnb_dir}/basicop2.c ${amrnb_dir}/oper_32b.c ${amrnb_dir}/set_zero.c ${amrnb_dir}/log2.c ${amrnb_dir}/copy.c ${amrnb_dir}/wamr.c) set(amrnb_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libwamrnb.a) endif(ENABLE_ENABLE_AMRNB) set(base64_dir ./app/base64) set(base64_files ${base64_dir}/base64.c) set(learn_dir ./app/learn) set(cjson_dir ./app/cJSON) set(cjson_files ${cjson_dir}/cJSON.c) set(app_files ${app_dir}/ohpocapp.c ${app_dir}/board.c ${app_dir}/log.c ${app_dir}/poc.c ${app_dir}/app.c ${app_dir}/uio.c ${app_dir}/common.c ${app_dir}/setting.c ${app_dir}/message.c ${app_dir}/gpsCtl.c ${app_dir}/hook.c ${app_dir}/setSystemPara.c ${app_dir}/GUI/lcdDrv.c ${app_dir}/GUI/gui.c ${app_dir}/GUI/fonts.c ${app_dir}/uiEntry.c ${app_dir}/uiBlock.c ${app_dir}/appAuth.c ${app_dir}/Interface/Palace.c ${app_dir}/Interface/uiMenu.c ${app_dir}/Interface/ListBox.c ${app_dir}/Interface/ListBoxSMS.c ${app_dir}/Interface/NumEdit.c ${app_dir}/Interface/ManageMessage.c ${app_dir}/md5/mymd5.c ${learn_dir}/learnHttp.c ${learn_dir}/learnTask.c ${learn_dir}/learnAudio.c ${cjson_files} ${spi_files} ${base64_files}) add_definitions(-w) include_directories(${app_dir} ${app_dir}/md5 ${app_dir}/GUI ${app_dir}/Interface ${learn_dir} ${cjson_dir} ${amrnb_dir} ${speex_h_dir} ${base64_dir}) set(app_lib ${CMAKE_CURRENT_SOURCE_DIR}/lib/libohpoc.a ${amrnb_lib}) add_appimg(${target} ${flash_ldscript} ${app_files}) target_link_libraries(${target} PRIVATE ${app_lib})