Skip to content

Commit 56e7092

Browse files
committed
Find the correct libgcc for Ubuntu 22.04 (and later), 32 Bit.
The same commit in the Maxima repository: https://sourceforge.net/p/maxima/code/ci/baf78ae3af4441159f915d01aab812df1d089aaa
1 parent 23263c9 commit 56e7092

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ message(STATUS "Copied and patched ${CMAKE_ROOT}/Modules/NSIS.template.in to ${C
6363
if(BUILD_64BIT)
6464
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -print-file-name=libgcc_s_seh-1.dll OUTPUT_VARIABLE MINGW_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
6565
else()
66+
# It's difficult. On Ubuntu 22.04 and 20.04 (64bit) the library libgcc is called libgcc_s_seh-1.dll.
67+
# On Ubuntu 20.04 (32bit) it is libgcc_s_sjlj-1.dll - that file does not exist in Ubuntu 22.04/24.04, there it is most likely libgcc_s_dw2-1.dll
6668
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -print-file-name=libgcc_s_sjlj-1.dll OUTPUT_VARIABLE MINGW_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
69+
if("${MINGW_LIBGCC}" STREQUAL "libgcc_s_sjlj-1.dll")
70+
# "${CMAKE_CXX_COMPILER}" -print-file-name=libgcc_s_sjlj-1.dll prints the same string, if the file was not found. Otherwise the full path to the library.
71+
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -print-file-name=libgcc_s_dw2-1.dll OUTPUT_VARIABLE MINGW_LIBGCC OUTPUT_STRIP_TRAILING_WHITESPACE)
72+
endif()
73+
6774
endif()
6875

6976
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" -print-file-name=libstdc++-6.dll OUTPUT_VARIABLE MINGW_LIBSTDCPP OUTPUT_STRIP_TRAILING_WHITESPACE)

0 commit comments

Comments
 (0)