blob: 2bcd5b8cbb72c74f5f1e4181cd763d4a41b3d97f [file] [log] [blame]
Don Turner1f6dcad2017-09-12 20:34:36 +01001cmake_minimum_required(VERSION 3.4.1)
2
Don Turnere3667ba2019-07-25 17:43:23 +01003# 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)
Kai Wolff39caf22019-03-16 16:39:54 +01007project(oboe)
Don Turner1f6dcad2017-09-12 20:34:36 +01008
Don Turner3bf32ae2017-11-27 13:25:05 +00009set (oboe_sources
Phil Burke4a2e9c2019-05-31 11:42:10 -070010 src/aaudio/AAudioLoader.cpp
11 src/aaudio/AudioStreamAAudio.cpp
12 src/common/AudioSourceCaller.cpp
13 src/common/AudioStream.cpp
14 src/common/AudioStreamBuilder.cpp
Phil Burkbeed0f32019-07-12 17:44:55 -070015 src/common/DataConversionFlowGraph.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070016 src/common/FilterAudioStream.cpp
Phil Burkbd76d6a2019-06-01 08:48:03 -070017 src/common/FixedBlockAdapter.cpp
18 src/common/FixedBlockReader.cpp
19 src/common/FixedBlockWriter.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070020 src/common/LatencyTuner.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070021 src/common/SourceFloatCaller.cpp
Phil Burkbd76d6a2019-06-01 08:48:03 -070022 src/common/SourceI16Caller.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070023 src/common/Utilities.cpp
Phil Burk41b121b2019-06-03 16:06:58 -070024 src/common/QuirksManager.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070025 src/fifo/FifoBuffer.cpp
26 src/fifo/FifoController.cpp
27 src/fifo/FifoControllerBase.cpp
28 src/fifo/FifoControllerIndirect.cpp
Phil Burk328860f2019-11-04 18:43:40 -080029 src/flowgraph/FlowGraphNode.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070030 src/flowgraph/ClipToRange.cpp
31 src/flowgraph/ManyToMultiConverter.cpp
32 src/flowgraph/MonoToMultiConverter.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070033 src/flowgraph/RampLinear.cpp
34 src/flowgraph/SampleRateConverter.cpp
35 src/flowgraph/SinkFloat.cpp
36 src/flowgraph/SinkI16.cpp
37 src/flowgraph/SinkI24.cpp
38 src/flowgraph/SourceFloat.cpp
39 src/flowgraph/SourceI16.cpp
40 src/flowgraph/SourceI24.cpp
Phil Burk8b8ae342019-07-16 17:55:54 -070041 src/flowgraph/resampler/IntegerRatio.cpp
42 src/flowgraph/resampler/LinearResampler.cpp
43 src/flowgraph/resampler/MultiChannelResampler.cpp
44 src/flowgraph/resampler/PolyphaseResampler.cpp
45 src/flowgraph/resampler/PolyphaseResamplerMono.cpp
46 src/flowgraph/resampler/PolyphaseResamplerStereo.cpp
47 src/flowgraph/resampler/SincResampler.cpp
48 src/flowgraph/resampler/SincResamplerStereo.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070049 src/opensles/AudioInputStreamOpenSLES.cpp
50 src/opensles/AudioOutputStreamOpenSLES.cpp
51 src/opensles/AudioStreamBuffered.cpp
52 src/opensles/AudioStreamOpenSLES.cpp
53 src/opensles/EngineOpenSLES.cpp
54 src/opensles/OpenSLESUtilities.cpp
55 src/opensles/OutputMixerOpenSLES.cpp
56 src/common/StabilizedCallback.cpp
57 src/common/Trace.cpp
58 src/common/Version.cpp
59 )
Don Turner3bf32ae2017-11-27 13:25:05 +000060
Atsushi Eno34fbeaf2019-03-07 20:48:17 +090061add_library(oboe ${oboe_sources})
Don Turnere6c1c742017-12-04 16:10:46 +000062
63# Specify directories which the compiler should look for headers
gerry1abf88e2018-06-07 10:07:05 -070064target_include_directories(oboe
Don Turnere3667ba2019-07-25 17:43:23 +010065 PRIVATE src
66 PUBLIC include)
Don Turnere6c1c742017-12-04 16:10:46 +000067
Don Turner66783b12018-08-01 17:24:12 +010068# Compile Flags:
69# Enable -Werror when building debug config
70# Enable -Ofast
ggfanc6ffd522018-07-31 22:58:58 -070071target_compile_options(oboe
Don Turner8bb93242019-05-22 16:41:47 +010072 PRIVATE
Don Turnere3667ba2019-07-25 17:43:23 +010073 -std=c++14
Don Turner8bb93242019-05-22 16:41:47 +010074 -Wall
75 -Wextra-semi
76 -Wshadow
77 -Wshadow-field
78 -Ofast
79 "$<$<CONFIG:DEBUG>:-Werror>")
ggfan32c67432018-07-27 16:09:09 -070080
Don Turner66783b12018-08-01 17:24:12 +010081# Enable logging for debug builds
Don Turner37575d02019-07-26 14:45:13 +010082target_compile_definitions(oboe PUBLIC $<$<CONFIG:DEBUG>:OBOE_ENABLE_LOGGING=1>)
Don Turner66783b12018-08-01 17:24:12 +010083
Phil Burk7040a9d2017-12-15 10:54:38 -080084target_link_libraries(oboe PRIVATE log OpenSLES)
Kai Wolff39caf22019-03-16 16:39:54 +010085
Don Turner82b68a92019-07-26 14:41:46 +010086# When installing oboe put the libraries in the lib/<ABI> folder e.g. lib/arm64-v8a
Kai Wolff39caf22019-03-16 16:39:54 +010087install(TARGETS oboe
Don Turner82b68a92019-07-26 14:41:46 +010088 LIBRARY DESTINATION lib/${ANDROID_ABI}
89 ARCHIVE DESTINATION lib/${ANDROID_ABI})
Kai Wolff39caf22019-03-16 16:39:54 +010090
Don Turner82b68a92019-07-26 14:41:46 +010091# Also install the headers
92install(DIRECTORY include/oboe DESTINATION include)