Add Apportable OpenAL to CMake
@@ -188,6 +188,9 @@ set(ALSOFT_EXAMPLES OFF CACHE BOOL "")
set(ALSOFT_TESTS OFF CACHE BOOL "")
if(EMSCRIPTEN)
include_directories(deps/openal-soft/include)
+elseif(OCULUS_ANDROID_EMBED)
+ include_directories(deps/openal-soft/include)
+ #include_directories(../../deps/openal-soft/jni/OpenAL/include)
elseif(WIN32)
add_subdirectory(deps/openal-soft openal)
include_directories(deps/openal-soft/include)
@@ -340,9 +343,25 @@ endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
if (OCULUS_ANDROID_EMBED)
+ get_filename_component(CURRENT_PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
+ get_filename_component(CURRENT_GRANDPARENT_DIR ${CURRENT_PARENT_DIR} DIRECTORY)
+ if(CMAKE_BUILD_TYPE STREQUAL "Release")
+ set(OCULUS_MOBILE_BUILD_TYPE "release")
+ else()
+ set(OCULUS_MOBILE_BUILD_TYPE "debug")
+ endif()
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(OCULUS_MOBILE_ARCH "arm64-v8a")
+ else()
+ set(OCULUS_MOBILE_ARCH "armeabi-v7a")
+ endif()
+
+
# For Oculus mobile ONLY we build as a library.
add_library(lovr SHARED ${LOVR_SRC} ${LOVR_HEADSET})
- target_link_libraries(lovr log EGL)
+ target_link_libraries(lovr log EGL
+ ${CURRENT_GRANDPARENT_DIR}/deps/openal-soft-gradle/build/intermediates/ndkBuild/${OCULUS_MOBILE_BUILD_TYPE}/obj/local/${OCULUS_MOBILE_ARCH}/libopenal.so
+ )
else()
add_executable(lovr ${LOVR_SRC} ${LOVR_HEADSET})
endif()
