@@ -35,8 +35,6 @@ include(cmake/GPL-3.0-or-later.cmake)
3535
3636set (DEV_MODE false CACHE BOOL "Enable developer options in this CMake, like packaging.\
3737 They should be ignored, when user just wants to build this project." )
38- set (FORCE_ELFLIB_STATIC false CACHE BOOL
39- "Use included statically linked libelf even if system one is available." )
4038set (SANITIZERS "address,undefined" CACHE STRING
4139 "Runtime sanitizers to use in debug builds.
4240 Column separated subset of {address, memory, undefined, thread} or none.
@@ -226,30 +224,11 @@ if ("${WASM}")
226224else ()
227225 # Not available for WASM
228226 enable_testing ()
229-
230- if (NOT "${FORCE_ELFLIB_STATIC} " )
231- find_package (LibElf)
232- if ("${LibElf_FOUND} " )
233- include (CheckSymbolExists)
234- check_symbol_exists(EM_RISCV "gelf.h" LIBELF_HAS_RISCV)
235- if ("${LIBELF_HAS_RISCV} " )
236- # Turn non-cmake library into a cmake target
237- add_library (libelf INTERFACE )
238- target_link_libraries (libelf INTERFACE ${LIBELF_LIBRARY} )
239- target_include_directories (libelf INTERFACE ${LIBELF_INCLUDE_DIR} )
240- message (STATUS "Using system libelf" )
241- else ()
242- message (STATUS "System libelf does not support RISC-V" )
243- set (LibElf_FOUND FALSE ) # Force fallback
244- endif ()
245- endif ()
246- endif ()
247227endif ()
248228
249- if ("${WASM} " OR "${FORCE_ELFLIB_STATIC} " OR NOT "${LibElf_FOUND} " )
250- message (STATUS "Using local libelf fallback." )
251- add_subdirectory ("external/libelf" )
252- endif ()
229+ # Always use libelfin (modern C++ ELF library)
230+ message (STATUS "Using libelfin (C++ ELF library)" )
231+ add_subdirectory ("external/libelfin" )
253232
254233# Detect Qt used qt version
255234# Based on article https://www.steinzone.de/wordpress/how-to-support-both-qt5-and-qt6-using-cmake/
0 commit comments