Skip to content

Commit

Permalink
Android: Build OpenAL Soft as a static library
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed May 23, 2019
1 parent fa5a946 commit 05f41e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -72,6 +72,7 @@ if(ANDROID)
set(ALSOFT_HRTF_DEFS OFF CACHE BOOL "Install HRTF definition files" FORCE)
set(ALSOFT_AMBDEC_PRESETS OFF CACHE BOOL "Install AmbDec preset files" FORCE)
set(ALSOFT_BACKEND_WAVE OFF CACHE BOOL "Enable Wave Writer backend" FORCE)
set(LIBTYPE "STATIC" CACHE STRING "" FORCE)
add_subdirectory(${ALSOFT_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/openal-soft)
set(OPENAL_LIBRARY OpenAL)
target_include_directories(jngl PRIVATE ${ALSOFT_SRC_DIR}/include)
Expand Down
8 changes: 0 additions & 8 deletions android/test/app/src/main/cpp/bootstrap.cpp
Expand Up @@ -38,14 +38,6 @@ void ANativeActivity_onCreate(ANativeActivity* app, void* ud, size_t udsize) {
const jbyte* const bytes = app->env->GetByteArrayElements(bytesObject, nullptr);
const std::string libDir(reinterpret_cast<const char*>(bytes), length);
try {
const auto openal = load_lib(libDir + "/libopenal.so");
const auto jni = reinterpret_cast<jint (*)(JavaVM*, void*)>(dlsym(openal, "JNI_OnLoad"));
if (jni) {
jni(app->vm, nullptr);
} else {
__android_log_print(ANDROID_LOG_INFO, "bootstrap", "Couldn't find JNI_OnLoad!");
}

auto main = reinterpret_cast<void (*)(ANativeActivity*, void*, size_t)>(
dlsym(load_lib(libDir + "/libjngl-test.so"), "ANativeActivity_onCreate"));
if (!main) {
Expand Down

0 comments on commit 05f41e1

Please sign in to comment.