Don Turner | 1f6dcad | 2017-09-12 20:34:36 +0100 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 3.4.1) |
| 2 | |
Don Turner | e3667ba | 2019-07-25 17:43:23 +0100 | [diff] [blame] | 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) |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 7 | project(oboe) |
Don Turner | 1f6dcad | 2017-09-12 20:34:36 +0100 | [diff] [blame] | 8 | |
Don Turner | 3bf32ae | 2017-11-27 13:25:05 +0000 | [diff] [blame] | 9 | set (oboe_sources |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 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 |
Phil Burk | beed0f3 | 2019-07-12 17:44:55 -0700 | [diff] [blame] | 15 | src/common/DataConversionFlowGraph.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 16 | src/common/FilterAudioStream.cpp |
Phil Burk | bd76d6a | 2019-06-01 08:48:03 -0700 | [diff] [blame] | 17 | src/common/FixedBlockAdapter.cpp |
| 18 | src/common/FixedBlockReader.cpp |
| 19 | src/common/FixedBlockWriter.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 20 | src/common/LatencyTuner.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 21 | src/common/SourceFloatCaller.cpp |
Phil Burk | bd76d6a | 2019-06-01 08:48:03 -0700 | [diff] [blame] | 22 | src/common/SourceI16Caller.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 23 | src/common/Utilities.cpp |
Phil Burk | 41b121b | 2019-06-03 16:06:58 -0700 | [diff] [blame] | 24 | src/common/QuirksManager.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 25 | src/fifo/FifoBuffer.cpp |
| 26 | src/fifo/FifoController.cpp |
| 27 | src/fifo/FifoControllerBase.cpp |
| 28 | src/fifo/FifoControllerIndirect.cpp |
Phil Burk | cb01be5 | 2020-06-16 16:37:37 -0700 | [diff] [blame] | 29 | src/flowgraph/FlowGraphNode.cpp |
| 30 | src/flowgraph/ChannelCountConverter.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 31 | src/flowgraph/ClipToRange.cpp |
| 32 | src/flowgraph/ManyToMultiConverter.cpp |
| 33 | src/flowgraph/MonoToMultiConverter.cpp |
Phil Burk | d12bb00 | 2020-06-11 16:49:57 -0700 | [diff] [blame] | 34 | src/flowgraph/MultiToMonoConverter.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 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 |
Phil Burk | 8b8ae34 | 2019-07-16 17:55:54 -0700 | [diff] [blame] | 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 |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 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 | ) |
Don Turner | 3bf32ae | 2017-11-27 13:25:05 +0000 | [diff] [blame] | 62 | |
Atsushi Eno | 34fbeaf | 2019-03-07 20:48:17 +0900 | [diff] [blame] | 63 | add_library(oboe ${oboe_sources}) |
Don Turner | e6c1c74 | 2017-12-04 16:10:46 +0000 | [diff] [blame] | 64 | |
| 65 | # Specify directories which the compiler should look for headers |
gerry | 1abf88e | 2018-06-07 10:07:05 -0700 | [diff] [blame] | 66 | target_include_directories(oboe |
Don Turner | e3667ba | 2019-07-25 17:43:23 +0100 | [diff] [blame] | 67 | PRIVATE src |
| 68 | PUBLIC include) |
Don Turner | e6c1c74 | 2017-12-04 16:10:46 +0000 | [diff] [blame] | 69 | |
Don Turner | 66783b1 | 2018-08-01 17:24:12 +0100 | [diff] [blame] | 70 | # Compile Flags: |
| 71 | # Enable -Werror when building debug config |
| 72 | # Enable -Ofast |
ggfan | c6ffd52 | 2018-07-31 22:58:58 -0700 | [diff] [blame] | 73 | target_compile_options(oboe |
Don Turner | 8bb9324 | 2019-05-22 16:41:47 +0100 | [diff] [blame] | 74 | PRIVATE |
Don Turner | e3667ba | 2019-07-25 17:43:23 +0100 | [diff] [blame] | 75 | -std=c++14 |
Don Turner | 8bb9324 | 2019-05-22 16:41:47 +0100 | [diff] [blame] | 76 | -Wall |
| 77 | -Wextra-semi |
| 78 | -Wshadow |
| 79 | -Wshadow-field |
| 80 | -Ofast |
| 81 | "$<$<CONFIG:DEBUG>:-Werror>") |
ggfan | 32c6743 | 2018-07-27 16:09:09 -0700 | [diff] [blame] | 82 | |
Phil Burk | c79dada | 2020-05-27 10:37:03 -0700 | [diff] [blame] | 83 | # Enable logging of D,V for debug builds |
Don Turner | 37575d0 | 2019-07-26 14:45:13 +0100 | [diff] [blame] | 84 | target_compile_definitions(oboe PUBLIC $<$<CONFIG:DEBUG>:OBOE_ENABLE_LOGGING=1>) |
Don Turner | 66783b1 | 2018-08-01 17:24:12 +0100 | [diff] [blame] | 85 | |
Phil Burk | 7040a9d | 2017-12-15 10:54:38 -0800 | [diff] [blame] | 86 | target_link_libraries(oboe PRIVATE log OpenSLES) |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 87 | |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 88 | # When installing oboe put the libraries in the lib/<ABI> folder e.g. lib/arm64-v8a |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 89 | install(TARGETS oboe |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 90 | LIBRARY DESTINATION lib/${ANDROID_ABI} |
| 91 | ARCHIVE DESTINATION lib/${ANDROID_ABI}) |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 92 | |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 93 | # Also install the headers |
| 94 | install(DIRECTORY include/oboe DESTINATION include) |