• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cmake_minimum_required(VERSION 3.4.1)
2
3# Set the name of the project and store it in PROJECT_NAME. Also set the following variables:
4# PROJECT_SOURCE_DIR (usually the root directory where Oboe has been cloned e.g.)
5# PROJECT_BINARY_DIR (usually the containing project's binary directory,
6# e.g. ${OBOE_HOME}/samples/RhythmGame/.externalNativeBuild/cmake/ndkExtractorDebug/x86/oboe-bin)
7project(oboe)
8
9set (oboe_sources
10    src/aaudio/AAudioLoader.cpp
11    src/aaudio/AudioStreamAAudio.cpp
12    src/common/AudioSourceCaller.cpp
13    src/common/AudioStream.cpp
14    src/common/AudioStreamBuilder.cpp
15    src/common/DataConversionFlowGraph.cpp
16    src/common/FilterAudioStream.cpp
17    src/common/FixedBlockAdapter.cpp
18    src/common/FixedBlockReader.cpp
19    src/common/FixedBlockWriter.cpp
20    src/common/LatencyTuner.cpp
21    src/common/SourceFloatCaller.cpp
22    src/common/SourceI16Caller.cpp
23    src/common/Utilities.cpp
24    src/common/QuirksManager.cpp
25    src/fifo/FifoBuffer.cpp
26    src/fifo/FifoController.cpp
27    src/fifo/FifoControllerBase.cpp
28    src/fifo/FifoControllerIndirect.cpp
29    src/flowgraph/FlowGraphNode.cpp
30    src/flowgraph/ChannelCountConverter.cpp
31    src/flowgraph/ClipToRange.cpp
32    src/flowgraph/ManyToMultiConverter.cpp
33    src/flowgraph/MonoToMultiConverter.cpp
34    src/flowgraph/MultiToMonoConverter.cpp
35    src/flowgraph/RampLinear.cpp
36    src/flowgraph/SampleRateConverter.cpp
37    src/flowgraph/SinkFloat.cpp
38    src/flowgraph/SinkI16.cpp
39    src/flowgraph/SinkI24.cpp
40    src/flowgraph/SourceFloat.cpp
41    src/flowgraph/SourceI16.cpp
42    src/flowgraph/SourceI24.cpp
43    src/flowgraph/resampler/IntegerRatio.cpp
44    src/flowgraph/resampler/LinearResampler.cpp
45    src/flowgraph/resampler/MultiChannelResampler.cpp
46    src/flowgraph/resampler/PolyphaseResampler.cpp
47    src/flowgraph/resampler/PolyphaseResamplerMono.cpp
48    src/flowgraph/resampler/PolyphaseResamplerStereo.cpp
49    src/flowgraph/resampler/SincResampler.cpp
50    src/flowgraph/resampler/SincResamplerStereo.cpp
51    src/opensles/AudioInputStreamOpenSLES.cpp
52    src/opensles/AudioOutputStreamOpenSLES.cpp
53    src/opensles/AudioStreamBuffered.cpp
54    src/opensles/AudioStreamOpenSLES.cpp
55    src/opensles/EngineOpenSLES.cpp
56    src/opensles/OpenSLESUtilities.cpp
57    src/opensles/OutputMixerOpenSLES.cpp
58    src/common/StabilizedCallback.cpp
59    src/common/Trace.cpp
60    src/common/Version.cpp
61    )
62
63add_library(oboe ${oboe_sources})
64
65# Specify directories which the compiler should look for headers
66target_include_directories(oboe
67        PRIVATE src
68        PUBLIC include)
69
70# Compile Flags:
71#     Enable -Werror when building debug config
72#     Enable -Ofast
73target_compile_options(oboe
74        PRIVATE
75        -std=c++14
76        -Wall
77        -Wextra-semi
78        -Wshadow
79        -Wshadow-field
80        -Ofast
81        "$<$<CONFIG:DEBUG>:-Werror>")
82
83# Enable logging of D,V for debug builds
84target_compile_definitions(oboe PUBLIC $<$<CONFIG:DEBUG>:OBOE_ENABLE_LOGGING=1>)
85
86target_link_libraries(oboe PRIVATE log OpenSLES)
87
88# When installing oboe put the libraries in the lib/<ABI> folder e.g. lib/arm64-v8a
89install(TARGETS oboe
90        LIBRARY DESTINATION lib/${ANDROID_ABI}
91        ARCHIVE DESTINATION lib/${ANDROID_ABI})
92
93# Also install the headers
94install(DIRECTORY include/oboe DESTINATION include)