1# For more information about using CMake with Android Studio, read the 2# documentation: https://d.android.com/studio/projects/add-native-code.html 3 4# Sets the minimum version of CMake required to build the native library. 5cmake_minimum_required(VERSION 3.4.1) 6 7#PROJECT(wavlib C CXX) 8 9#message("CMAKE_CURRENT_LIST_DIR = " ${CMAKE_CURRENT_LIST_DIR}) 10 11#message("HOME is " ${HOME}) 12 13# SET(NDK "") 14#message("NDK is " ${NDK}) 15 16# Set the path to the Oboe library directory 17set (OBOE_DIR ../../../../../) 18#message("OBOE_DIR = " + ${OBOE_DIR}) 19 20# Pull in parselib 21set (PARSELIB_DIR ../../../../parselib) 22#message("PARSELIB_DIR = " + ${PARSELIB_DIR}) 23 24# compiler flags 25# -mhard-float -D_NDK_MATH_NO_SOFTFP=1 26#SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mhard-float -D_NDK_MATH_NO_SOFTFP=1" ) 27 28# include folders 29include_directories( 30 ${PARSELIB_DIR}/src/main/cpp 31 ${OBOE_DIR}/include 32 ${OBOE_DIR}/src/flowgraph 33 ${CMAKE_CURRENT_LIST_DIR} 34 ../../../../shared) 35 36# Creates and names a library, sets it as either STATIC 37# or SHARED, and provides the relative paths to its source code. 38# You can define multiple libraries, and CMake builds them for you. 39# Gradle automatically packages shared libraries with your APK. 40 41add_library( # Sets the name of the library. 42 iolib 43 44 # Sets the library as a static library. 45 STATIC 46 47 # source 48 ${CMAKE_CURRENT_LIST_DIR}/player/SampleSource.cpp 49 ${CMAKE_CURRENT_LIST_DIR}/player/SampleBuffer.cpp 50 ${CMAKE_CURRENT_LIST_DIR}/player/OneShotSampleSource.cpp 51 ${CMAKE_CURRENT_LIST_DIR}/player/SimpleMultiPlayer.cpp) 52 53# Specifies libraries CMake should link to your target library. You 54# can link multiple libraries, such as libraries you define in this 55# build script, prebuilt third-party libraries, or system libraries. 56 57target_link_libraries( # Specifies the target library. 58 iolib 59 60 # Links the target library to the log library 61 # included in the NDK. 62 log) 63