CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) project(evrcc) if(CMAKE_CROSSCOMPILING) set(CMAKE_C_FLAGS "-O3 -D__ARM_ARCH__=7 -DANDROID") add_definitions(-mcpu=cortex-a8 -mfpu=neon) endif(CMAKE_CROSSCOMPILING) #include(CMakeSymbols) #include(CMakeStdOpt) set(DSP_ARM_DIR dsp_arm) set(DSP_MATH_DIR dspmath) set(CODE_DIR code) if(CMAKE_CROSSCOMPILING) enable_language(ASM-ATT) set(DSP_ARM_SRC ${DSP_ARM_DIR}/abs_s.s ${DSP_ARM_DIR}/dsp_math.c ${DSP_ARM_DIR}/l_add.s ${DSP_ARM_DIR}/l_sub.s ${DSP_ARM_DIR}/l_mac.s ${DSP_ARM_DIR}/l_msu.s ${DSP_ARM_DIR}/l_shr.s ${DSP_ARM_DIR}/l_shl.s ${DSP_ARM_DIR}/divide_s.s ${DSP_ARM_DIR}/l_abs.s ${DSP_ARM_DIR}/l_mult.s ${DSP_ARM_DIR}/mac_r.s ${DSP_ARM_DIR}/sub.s ${DSP_ARM_DIR}/add.s ${DSP_ARM_DIR}/mult_r.s ${DSP_ARM_DIR}/negate.s ${DSP_ARM_DIR}/norm_s.s ${DSP_ARM_DIR}/shr_r.s ${DSP_ARM_DIR}/shift_r.s ${DSP_ARM_DIR}/msu_r.s ${DSP_ARM_DIR}/l_negate.s ${DSP_ARM_DIR}/l_shr_r.s ${DSP_ARM_DIR}/l_shift_r.s ${DSP_ARM_DIR}/norm_l.s ${DSP_ARM_DIR}/mult.s ${DSP_ARM_DIR}/round32.s ${DSP_ARM_DIR}/shl.s ${DSP_ARM_DIR}/shr.s ${DSP_ARM_DIR}/saturate.s ${DSP_ARM_DIR}/l_mpy_ls.s ${DSP_ARM_DIR}/l_mpy_ll.s ${DSP_ARM_DIR}/div_32.s ${DSP_ARM_DIR}/fft_tabs.s ${DSP_ARM_DIR}/c_fft.s ${DSP_ARM_DIR}/test.s ) set(DSP_MATH_SRC ${DSP_MATH_DIR}/mathadv.c ${DSP_MATH_DIR}/ehwutl.c ${DSP_MATH_DIR}/globdefs.c ) else(CMAKE_CROSSCOMPILING) set(DSP_MATH_SRC ${DSP_MATH_DIR}/mathevrc.c ${DSP_MATH_DIR}/mathadv.c ${DSP_MATH_DIR}/ehwutl.c ${DSP_MATH_DIR}/globdefs.c ${DSP_MATH_DIR}/mathdp31.c) endif(CMAKE_CROSSCOMPILING) set(CODE_SRC ${CODE_DIR}/acb_ex.c ${CODE_DIR}/acelp_pf.c ${CODE_DIR}/apf.c ${CODE_DIR}/auto.c ${CODE_DIR}/a2lsp.c ${CODE_DIR}/bitpack.c ${CODE_DIR}/bitupack.c ${CODE_DIR}/bl_intrp.c ${CODE_DIR}/bqiir.c ${CODE_DIR}/c3_10pf.c ${CODE_DIR}/c8_35pf.c ${CODE_DIR}/comacb.c ${CODE_DIR}/convh.c ${CODE_DIR}/cshift.c ${CODE_DIR}/d3_10pf.c ${CODE_DIR}/d8_35pf.c ${CODE_DIR}/decode.c ${CODE_DIR}/d_fer.c ${CODE_DIR}/d_no_fer.c ${CODE_DIR}/d_rate_1.c ${CODE_DIR}/durbin.c ${CODE_DIR}/encode.c ${CODE_DIR}/fcbgq.c ${CODE_DIR}/fer.c ${CODE_DIR}/filter.c ${CODE_DIR}/fndppf.c ${CODE_DIR}/getext1k.c ${CODE_DIR}/getgain.c ${CODE_DIR}/getres.c ${CODE_DIR}/impulser.c ${CODE_DIR}/interpol.c ${CODE_DIR}/intr_cos.c ${CODE_DIR}/inv_sqrt.c ${CODE_DIR}/lpcana.c ${CODE_DIR}/lspmaq.c ${CODE_DIR}/lsp2a.c ${CODE_DIR}/maxeloc.c ${CODE_DIR}/mdfyorig.c ${CODE_DIR}/mod.c ${CODE_DIR}/ns127.c ${CODE_DIR}/pit_shrp.c ${CODE_DIR}/pktoav.c ${CODE_DIR}/pre_enc.c ${CODE_DIR}/putacbc.c ${CODE_DIR}/r_fft.c ${CODE_DIR}/rda.c ${CODE_DIR}/rom.c ${CODE_DIR}/synfltr.c ${CODE_DIR}/weight.c ${CODE_DIR}/w2res.c ${CODE_DIR}/zeroinpt.c ${CODE_DIR}/globs.c ${CODE_DIR}/e_globs.c ${CODE_DIR}/d_globs.c ) if(CMAKE_CROSSCOMPILING) set(EVRCC_SRC ${DSP_ARM_SRC} ${DSP_MATH_SRC} ${CODE_SRC} evrcc.c evrcpacket.c) else(CMAKE_CROSSCOMPILING) set(EVRCC_SRC ${DSP_MATH_SRC} ${CODE_SRC} evrcc.c evrcpacket.c) endif(CMAKE_CROSSCOMPILING) add_library(evrcc SHARED ${EVRCC_SRC} ${EVRCC_HEADER}) if(CMAKE_CROSSCOMPILING) else() target_compile_options(evrcc PRIVATE "-fvisibility=hidden") endif() target_include_directories(evrcc PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE include PRIVATE ${DSP_MATH_DIR} PRIVATE ${CODE_DIR} ) install(TARGETS evrcc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) target_link_libraries(evrcc m) add_executable(evrc_codec evrc_codec.cpp) target_link_libraries(evrc_codec evrcc) target_link_libraries(evrc_codec m) install(TARGETS evrc_codec DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) #add_symbols(evrcc)