1cmake_minimum_required(VERSION 3.4.1) 2 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. 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) 9 10set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -std=c++14") 11 12# Include GoogleTest library 13set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest) 14add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc) 15target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT}) 16target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include) 17 18# Include Oboe sources 19set (OBOE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) 20add_subdirectory(${OBOE_DIR} ./oboe-bin) 21include_directories( 22 ${OBOE_DIR}/include 23 ${OBOE_DIR}/src 24 ) 25 26# Build the test binary 27add_executable( 28 testOboe 29 testAAudio.cpp 30 testUtilities.cpp 31 testFlowgraph.cpp 32 testStreamClosedMethods.cpp 33 testStreamWaitState.cpp 34 testXRunBehaviour.cpp 35 testStreamOpen.cpp 36 testStreamStates.cpp 37 ) 38 39target_link_libraries(testOboe gtest oboe) 40