blob: 51a45b2c5e36f11f29f2cc3e5c2f0762427f3a00 [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 Burkcb01be52020-06-16 16:37:37 -070029 src/flowgraph/FlowGraphNode.cpp
30 src/flowgraph/ChannelCountConverter.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070031 src/flowgraph/ClipToRange.cpp
32 src/flowgraph/ManyToMultiConverter.cpp
33 src/flowgraph/MonoToMultiConverter.cpp
Phil Burkd12bb002020-06-11 16:49:57 -070034 src/flowgraph/MultiToMonoConverter.cpp
Phil Burke4a2e9c2019-05-31 11:42:10 -070035 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
Phil Burk8b8ae342019-07-16 17:55:54 -070043 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
Phil Burke4a2e9c2019-05-31 11:42:10 -070051 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 )
Don Turner3bf32ae2017-11-27 13:25:05 +000062
Atsushi Eno34fbeaf2019-03-07 20:48:17 +090063add_library(oboe ${oboe_sources})
Don Turnere6c1c742017-12-04 16:10:46 +000064
65# Specify directories which the compiler should look for headers
gerry1abf88e2018-06-07 10:07:05 -070066target_include_directories(oboe
Don Turnere3667ba2019-07-25 17:43:23 +010067 PRIVATE src
68 PUBLIC include)
Don Turnere6c1c742017-12-04 16:10:46 +000069
Don Turner66783b12018-08-01 17:24:12 +010070# Compile Flags:
71# Enable -Werror when building debug config
72# Enable -Ofast
ggfanc6ffd522018-07-31 22:58:58 -070073target_compile_options(oboe
Don Turner8bb93242019-05-22 16:41:47 +010074 PRIVATE
Don Turnere3667ba2019-07-25 17:43:23 +010075 -std=c++14
Don Turner8bb93242019-05-22 16:41:47 +010076 -Wall
77 -Wextra-semi
78 -Wshadow
79 -Wshadow-field
80 -Ofast
81 "$<$<CONFIG:DEBUG>:-Werror>")
ggfan32c67432018-07-27 16:09:09 -070082
Phil Burkc79dada2020-05-27 10:37:03 -070083# Enable logging of D,V for debug builds
Don Turner37575d02019-07-26 14:45:13 +010084target_compile_definitions(oboe PUBLIC $<$<CONFIG:DEBUG>:OBOE_ENABLE_LOGGING=1>)
Don Turner66783b12018-08-01 17:24:12 +010085
Phil Burk7040a9d2017-12-15 10:54:38 -080086target_link_libraries(oboe PRIVATE log OpenSLES)
Kai Wolff39caf22019-03-16 16:39:54 +010087
Don Turner82b68a92019-07-26 14:41:46 +010088# When installing oboe put the libraries in the lib/<ABI> folder e.g. lib/arm64-v8a
Kai Wolff39caf22019-03-16 16:39:54 +010089install(TARGETS oboe
Don Turner82b68a92019-07-26 14:41:46 +010090 LIBRARY DESTINATION lib/${ANDROID_ABI}
91 ARCHIVE DESTINATION lib/${ANDROID_ABI})
Kai Wolff39caf22019-03-16 16:39:54 +010092
Don Turner82b68a92019-07-26 14:41:46 +010093# Also install the headers
94install(DIRECTORY include/oboe DESTINATION include)