Don Turner | fda6701 | 2018-01-19 18:10:25 +0000 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 3.4.1) |
| 2 | |
Don Turner | f9d2605 | 2019-03-27 16:05:50 +0000 | [diff] [blame] | 3 | # Usually this file is called from run_tests.sh which requires the $ANDROID_NDK variable to be set so there's no need |
| 4 | # to set it here. Comments below are left in intentionally in case they're useful in future. |
Phil Burk | 25c8715 | 2019-03-26 14:16:51 -0700 | [diff] [blame] | 5 | # This may work on Mac OS. |
| 6 | # set(ANDROID_NDK $ENV{HOME}/Library/Android/sdk/ndk-bundle) |
| 7 | # This may work on Linux. |
| 8 | # set(ANDROID_NDK $ENV{HOME}/Android/sdk/ndk-bundle) |
Don Turner | 6ee9cf3 | 2018-07-12 18:09:59 +0100 | [diff] [blame] | 9 | |
Phil Burk | 83ceba1 | 2019-05-29 09:49:38 -0700 | [diff] [blame] | 10 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -std=c++14") |
| 11 | |
Don Turner | 94fe485 | 2018-07-03 08:42:09 +0100 | [diff] [blame] | 12 | # Include GoogleTest library |
Don Turner | eb236cc | 2018-07-03 08:33:05 +0100 | [diff] [blame] | 13 | set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest) |
Don Turner | fda6701 | 2018-01-19 18:10:25 +0000 | [diff] [blame] | 14 | add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc) |
| 15 | target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT}) |
| 16 | target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include) |
| 17 | |
Don Turner | 94fe485 | 2018-07-03 08:42:09 +0100 | [diff] [blame] | 18 | # Include Oboe sources |
| 19 | set (OBOE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) |
| 20 | add_subdirectory(${OBOE_DIR} ./oboe-bin) |
Phil Burk | 83ceba1 | 2019-05-29 09:49:38 -0700 | [diff] [blame] | 21 | include_directories( |
| 22 | ${OBOE_DIR}/include |
| 23 | ${OBOE_DIR}/src |
| 24 | ) |
Don Turner | 94fe485 | 2018-07-03 08:42:09 +0100 | [diff] [blame] | 25 | |
| 26 | # Build the test binary |
Phil Burk | 83ceba1 | 2019-05-29 09:49:38 -0700 | [diff] [blame] | 27 | add_executable( |
Phil Burk | 8f49571 | 2020-01-27 14:30:10 -0800 | [diff] [blame] | 28 | testOboe |
Don Turner | 94fe485 | 2018-07-03 08:42:09 +0100 | [diff] [blame] | 29 | testUtilities.cpp |
Phil Burk | 8f49571 | 2020-01-27 14:30:10 -0800 | [diff] [blame] | 30 | # testFlowgraph.cpp |
Phil Burk | f67a97f | 2019-05-30 12:48:17 -0700 | [diff] [blame] | 31 | testStreamClosedMethods.cpp |
Phil Burk | f67a97f | 2019-05-30 12:48:17 -0700 | [diff] [blame] | 32 | testStreamWaitState.cpp |
Phil Burk | f67a97f | 2019-05-30 12:48:17 -0700 | [diff] [blame] | 33 | testXRunBehaviour.cpp |
Phil Burk | 8f49571 | 2020-01-27 14:30:10 -0800 | [diff] [blame] | 34 | testStreamOpen.cpp |
| 35 | testStreamStates.cpp |
Don Turner | 94fe485 | 2018-07-03 08:42:09 +0100 | [diff] [blame] | 36 | ) |
Don Turner | ba5a01b | 2018-07-10 18:40:20 +0100 | [diff] [blame] | 37 | target_link_libraries(testOboe gtest oboe) |