Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uhjdecoder and uhjencoder #866

Open
ryandesign opened this issue Jun 25, 2023 · 1 comment
Open

uhjdecoder and uhjencoder #866

ryandesign opened this issue Jun 25, 2023 · 1 comment

Comments

@ryandesign
Copy link

If libsndfile is found when cmake is run for openal-soft, then uhjdecoder and uhjencoder are built.

openal-soft/CMakeLists.txt

Lines 1577 to 1595 in d3875f3

if(SNDFILE_FOUND)
add_executable(uhjdecoder utils/uhjdecoder.cpp)
target_compile_definitions(uhjdecoder PRIVATE ${CPP_DEFS})
target_include_directories(uhjdecoder
PRIVATE ${OpenAL_BINARY_DIR} ${OpenAL_SOURCE_DIR}/common)
target_compile_options(uhjdecoder PRIVATE ${C_FLAGS})
target_link_libraries(uhjdecoder PUBLIC common
PRIVATE ${LINKER_FLAGS} SndFile::SndFile ${UNICODE_FLAG})
set_target_properties(uhjdecoder PROPERTIES ${DEFAULT_TARGET_PROPS})
add_executable(uhjencoder utils/uhjencoder.cpp)
target_compile_definitions(uhjencoder PRIVATE ${CPP_DEFS})
target_include_directories(uhjencoder
PRIVATE ${OpenAL_BINARY_DIR} ${OpenAL_SOURCE_DIR}/common)
target_compile_options(uhjencoder PRIVATE ${C_FLAGS})
target_link_libraries(uhjencoder PUBLIC common
PRIVATE ${LINKER_FLAGS} SndFile::SndFile ${UNICODE_FLAG})
set_target_properties(uhjencoder PROPERTIES ${DEFAULT_TARGET_PROPS})
endif()

These executables are not installed. Should they be? If not, what is their purpose?

The unanticipated optional use of libsndfile caused a build failure of openal-soft for a MacPorts user. If these executable should not be installed, can the detection and use of libsndfile be prevented via some cmake flag? The use of other libraries can be prevented with a flag, for example:

openal-soft/CMakeLists.txt

Lines 906 to 907 in d3875f3

option(ALSOFT_BACKEND_PULSEAUDIO "Enable PulseAudio backend" ON)
option(ALSOFT_REQUIRE_PULSEAUDIO "Require PulseAudio backend" OFF)

but I didn't see such a flag to prevent the use of libsndfile.

@kcat
Copy link
Owner

kcat commented Jun 25, 2023

These executables are not installed. Should they be? If not, what is their purpose?

Their purpose is to encode and decode UHJ audio files, which OpenAL Soft can use with the AL_SOFT_UHJ extension. The main reason they're not installed is because they lack distinctive names ("uhj" isn't unique to OpenAL), it's not out of the question that another package could have programs with the same names and cause conflicts. Otherwise, they're not too useful to most users, but can be useful to some that may want to work with or use UHJ content if they don't already have something else to do the job.

The use of other libraries can be prevented with a flag, for example:

Those prevent enabling backends, some of which happen to correspond to specific libraries. libsndfile is used by the uhjdecoder and uhjencoder utilities, as well as a number of examples (alplay, alstream, etc). If you don't want to disable the utility and example programs, it is possible to prevent cmake from finding specific libraries or packages generically. Passing -DCMAKE_DISABLE_FIND_PACKAGE_SndFile=TRUE to cmake should prevent libsndfile from being found (find_package(SndFile) will fail) even if it's available, preventing the specific utilities and examples that need it from building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants