• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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# compiler flags
17# -mhard-float -D_NDK_MATH_NO_SOFTFP=1
18#SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -mhard-float -D_NDK_MATH_NO_SOFTFP=1" )
19
20# Set the path to the Oboe library directory
21set (OBOE_DIR ../../../../../)
22message("OBOE_DIR = " + ${OBOE_DIR})
23
24#add_subdirectory(${OBOE_DIR} ./oboe-bin)
25
26# include folders
27include_directories(
28        ${OBOE_DIR}/include
29        ${CMAKE_CURRENT_LIST_DIR}
30        ../../../../shared)
31
32# Creates and names a library, sets it as either STATIC
33# or SHARED, and provides the relative paths to its source code.
34# You can define multiple libraries, and CMake builds them for you.
35# Gradle automatically packages shared libraries with your APK.
36
37add_library( # Sets the name of the library.
38        parselib
39
40        # Sets the library as a static library.
41        STATIC
42
43        # Provides a relative path to your source file(s).
44        # stream
45        ${CMAKE_CURRENT_LIST_DIR}/stream/FileInputStream.cpp
46        ${CMAKE_CURRENT_LIST_DIR}/stream/InputStream.cpp
47        ${CMAKE_CURRENT_LIST_DIR}/stream/MemInputStream.cpp
48        # wav
49        ${CMAKE_CURRENT_LIST_DIR}/wav/AudioEncoding.cpp
50        ${CMAKE_CURRENT_LIST_DIR}/wav/WavChunkHeader.cpp
51        ${CMAKE_CURRENT_LIST_DIR}/wav/WavFmtChunkHeader.cpp
52        ${CMAKE_CURRENT_LIST_DIR}/wav/WavRIFFChunkHeader.cpp
53        ${CMAKE_CURRENT_LIST_DIR}/wav/WavStreamReader.cpp)
54
55# Specifies libraries CMake should link to your target library. You
56# can link multiple libraries, such as libraries you define in this
57# build script, prebuilt third-party libraries, or system libraries.
58
59target_link_libraries( # Specifies the target library.
60            parselib
61
62            # Links the target library to the log library
63            # included in the NDK.
64            log)
65