Menu

#359 Errors fixes in ports/cmake plus Android Cross Compiling

1.32.x
closed-fixed
nobody
None
5
2023-09-27
2023-09-24
No

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.

2 Attachments

Discussion

  • Thomas Orgis

    Thomas Orgis - 2023-09-25

    Slightly adapted … how is the current state of trunk for you?

     
  • Sylvain Carette

    Sylvain Carette - 2023-09-25

    All good to me.
    Putting the option in the same file make sense.

     
  • Thomas Orgis

    Thomas Orgis - 2023-09-27
    • status: open --> closed-fixed
     
  • Thomas Orgis

    Thomas Orgis - 2023-09-27

    Fix released with 1.32.2.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.