The attached patches addresses the following issues in the /ports/cmake directory of mpg123:
1 - Fixes a typo at line 13 in /ports/cmake/src/compat/CMakeLists.txt.
2 - Removes a redundant statement (line 151-152) in the elseif(MACHINE STREQUAL "x86")
in /ports/cmake/src/mpg123/CMakeLists.txt.
3 - Adds Android-specific cross compiling handling for SSE.
1 & 2: The typo and redundant line are minor issues that needed rectification for clarity and efficiency.
3: The existing system check for SSE is not suited for Android cross-compiling as it could give irrelevant or incorrect results.
Corrections:
1 & 2: Corrects the typo and removes the redundant line.
3: Added WITH_SSE
user variable - default ON - which reset the result of the system check if Android
is set.
in /ports/src/CMakeLists.txt line 13:
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
option(WITH_SSE "Turn OFF for x86 build without SSE support - targets older devices" ON)
endif()
in /ports/scr/libmpg123/CMakeLists.txt line 127:
cmake_host_system_information(RESULT HAVE_SSE QUERY HAS_SSE)
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(HAVE_SSE ${WITH_SSE})
endif()
The reasoning here is since we must decide in advance when cross compiling, and since most x86 android devices support sse, WITH_SSE
is ON by default while letting the user choose if targeting a very old device.
Tests:
The changes have been tested in a cross-compiling environment for Android, and they resolve the above-mentioned issues. The resulting mpg123 library is used as a static libsndfile external lib.
Attached is the patches that includes these fixes.
PS: The "Disclaimer" in /ports/cmake/src/README make the script look scary with comments like "Use at your own risk". Actually, the cmake script is very comprehensive and well structured, so thanks to the anonymous contributor.
Slightly adapted … how is the current state of trunk for you?
All good to me.
Putting the option in the same file make sense.
Fix released with 1.32.2.