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 | 328860f | 2019-11-04 18:43:40 -0800 | [diff] [blame] | 29 | src/flowgraph/FlowGraphNode.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 30 | src/flowgraph/ClipToRange.cpp |
| 31 | src/flowgraph/ManyToMultiConverter.cpp |
| 32 | src/flowgraph/MonoToMultiConverter.cpp |
Phil Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 33 | 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 Burk | 8b8ae34 | 2019-07-16 17:55:54 -0700 | [diff] [blame] | 41 | 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 Burk | e4a2e9c | 2019-05-31 11:42:10 -0700 | [diff] [blame] | 49 | 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 Turner | 3bf32ae | 2017-11-27 13:25:05 +0000 | [diff] [blame] | 60 | |
Atsushi Eno | 34fbeaf | 2019-03-07 20:48:17 +0900 | [diff] [blame] | 61 | add_library(oboe ${oboe_sources}) |
Don Turner | e6c1c74 | 2017-12-04 16:10:46 +0000 | [diff] [blame] | 62 | |
| 63 | # Specify directories which the compiler should look for headers |
gerry | 1abf88e | 2018-06-07 10:07:05 -0700 | [diff] [blame] | 64 | target_include_directories(oboe |
Don Turner | e3667ba | 2019-07-25 17:43:23 +0100 | [diff] [blame] | 65 | PRIVATE src |
| 66 | PUBLIC include) |
Don Turner | e6c1c74 | 2017-12-04 16:10:46 +0000 | [diff] [blame] | 67 | |
Don Turner | 66783b1 | 2018-08-01 17:24:12 +0100 | [diff] [blame] | 68 | # Compile Flags: |
| 69 | # Enable -Werror when building debug config |
| 70 | # Enable -Ofast |
ggfan | c6ffd52 | 2018-07-31 22:58:58 -0700 | [diff] [blame] | 71 | target_compile_options(oboe |
Don Turner | 8bb9324 | 2019-05-22 16:41:47 +0100 | [diff] [blame] | 72 | PRIVATE |
Don Turner | e3667ba | 2019-07-25 17:43:23 +0100 | [diff] [blame] | 73 | -std=c++14 |
Don Turner | 8bb9324 | 2019-05-22 16:41:47 +0100 | [diff] [blame] | 74 | -Wall |
| 75 | -Wextra-semi |
| 76 | -Wshadow |
| 77 | -Wshadow-field |
| 78 | -Ofast |
| 79 | "$<$<CONFIG:DEBUG>:-Werror>") |
ggfan | 32c6743 | 2018-07-27 16:09:09 -0700 | [diff] [blame] | 80 | |
Don Turner | 66783b1 | 2018-08-01 17:24:12 +0100 | [diff] [blame] | 81 | # Enable logging for debug builds |
Don Turner | 37575d0 | 2019-07-26 14:45:13 +0100 | [diff] [blame] | 82 | target_compile_definitions(oboe PUBLIC $<$<CONFIG:DEBUG>:OBOE_ENABLE_LOGGING=1>) |
Don Turner | 66783b1 | 2018-08-01 17:24:12 +0100 | [diff] [blame] | 83 | |
Phil Burk | 7040a9d | 2017-12-15 10:54:38 -0800 | [diff] [blame] | 84 | target_link_libraries(oboe PRIVATE log OpenSLES) |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 85 | |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 86 | # 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] | 87 | install(TARGETS oboe |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 88 | LIBRARY DESTINATION lib/${ANDROID_ABI} |
| 89 | ARCHIVE DESTINATION lib/${ANDROID_ABI}) |
Kai Wolf | f39caf2 | 2019-03-16 16:39:54 +0100 | [diff] [blame] | 90 | |
Don Turner | 82b68a9 | 2019-07-26 14:41:46 +0100 | [diff] [blame] | 91 | # Also install the headers |
| 92 | install(DIRECTORY include/oboe DESTINATION include) |