blob: 433e5464e850ddef2203ca2ba1ba6d5197e65ba2 [file] [log] [blame]
Don Turnerfda67012018-01-19 18:10:25 +00001cmake_minimum_required(VERSION 3.4.1)
2
Don Turnerf9d26052019-03-27 16:05:50 +00003# 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 Burk25c87152019-03-26 14:16:51 -07005# 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 Turner6ee9cf32018-07-12 18:09:59 +01009
Don Turner94fe4852018-07-03 08:42:09 +010010# Include GoogleTest library
Don Turnereb236cc2018-07-03 08:33:05 +010011set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest)
Don Turnerfda67012018-01-19 18:10:25 +000012add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc)
13target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT})
14target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include)
15
Don Turner94fe4852018-07-03 08:42:09 +010016# Include Oboe sources
17set (OBOE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
18add_subdirectory(${OBOE_DIR} ./oboe-bin)
19include_directories(${OBOE_DIR}/include)
20
21# Build the test binary
22add_executable(testOboe
23 testUtilities.cpp
24 testStreamClosedMethods.cpp
Don Turner0412fd52018-07-18 17:08:34 +010025 testStreamStates.cpp
Don Turner63fef122018-08-24 12:51:58 +010026 testStreamOpen.cpp
Don Turnerff649d02018-07-04 18:35:02 +010027 testXRunBehaviour.cpp
Don Turner94fe4852018-07-03 08:42:09 +010028 )
Don Turnerba5a01b2018-07-10 18:40:20 +010029target_link_libraries(testOboe gtest oboe)