kcat/openal-soft

Missing `EXCLUDE_FROM_ALL` for Oboe from source

hhromic opened this issue · 1 comments

First of all, thanks for developing and maintaining OpenAL Soft. It is much appreciated.

While making prebuilt binaries of OpenAL Soft for Android with Oboe support for our project, I noticed that Oboe headers and static library archives get installed alongside OpenAL Soft itself when running cmake --install (or equivalent).

The resaon seems to be that the Oboe CMakeLists file uses the following install commands:
https://github.com/google/oboe/blob/03242e9ef9495e418e6ae83954d239dc9193ec5c/CMakeLists.txt#L100-L106

Those get inherited by the OpenAL Soft library target because add_directory() is not using EXCLUDE_FROM_ALL here:

openal-soft/CMakeLists.txt

Lines 1111 to 1114 in d3875f3

if(OBOE_SOURCE)
add_subdirectory(${OBOE_SOURCE} ./oboe)
set(OBOE_TARGET oboe)
else()

After building and installing OpenAL Soft, the following is the resulting file-tree in CMAKE_INSTALL_PREFIX:

include/oboe/StabilizedCallback.h
include/oboe/FullDuplexStream.h
include/oboe/Utilities.h
include/oboe/ResultWithValue.h
include/oboe/Definitions.h
include/oboe/OboeExtensions.h
include/oboe/FifoControllerBase.h
include/oboe/Oboe.h
include/oboe/AudioStreamBase.h
include/oboe/LatencyTuner.h
include/oboe/AudioStreamBuilder.h
include/oboe/FifoBuffer.h
include/oboe/AudioStream.h
include/oboe/AudioStreamCallback.h
include/oboe/Version.h
include/AL/al.h
include/AL/efx-creative.h
include/AL/alext.h
include/AL/alc.h
include/AL/efx.h
include/AL/efx-presets.h
lib/pkgconfig/openal.pc
lib/cmake/OpenAL/OpenALTargets-relwithdebinfo.cmake
lib/cmake/OpenAL/OpenALTargets.cmake
lib/cmake/OpenAL/OpenALConfig.cmake
lib/libopenal.so
lib/x86_64/liboboe.a

When I add EXCLUDE_FROM_ALL to the Oboe add_directory() command, the resulting file-tree only contains OpenAL Soft headers/libs as expected:

include/AL/al.h
include/AL/efx-creative.h
include/AL/alext.h
include/AL/alc.h
include/AL/efx.h
include/AL/efx-presets.h
lib/pkgconfig/openal.pc
lib/cmake/OpenAL/OpenALTargets-relwithdebinfo.cmake
lib/cmake/OpenAL/OpenALTargets.cmake
lib/cmake/OpenAL/OpenALConfig.cmake
lib/libopenal.so

I understand that Oboe from source is compiled statically into libopenal.so, and that OpenAL Soft abstracts Oboe as a backend. Therefore there should be no need to install Oboe header/lib files alongside OpenAL Soft.

Should Oboe from source be added using EXCLUDE_FROM_ALL?
I can make a quick PR fixing this if you agree. Cheers!

kcat commented

It would seem to make sense to add EXCLUDE_FROM_ALL to the add_subdirectory for Oboe, yeah. I wasn't aware it also caused Oboe's headers and libs to get installed alongside OpenAL Soft's.