Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ include(cmake/GPL-3.0-or-later.cmake)

set(DEV_MODE false CACHE BOOL "Enable developer options in this CMake, like packaging.\
They should be ignored, when user just wants to build this project.")
set(FORCE_ELFLIB_STATIC false CACHE BOOL
"Use included statically linked libelf even if system one is available.")
set(SANITIZERS "address,undefined" CACHE STRING
"Runtime sanitizers to use in debug builds.
Column separated subset of {address, memory, undefined, thread} or none.
Expand Down Expand Up @@ -226,30 +224,11 @@ if ("${WASM}")
else ()
# Not available for WASM
enable_testing()

if (NOT "${FORCE_ELFLIB_STATIC}")
find_package(LibElf)
if ("${LibElf_FOUND}")
include(CheckSymbolExists)
check_symbol_exists(EM_RISCV "gelf.h" LIBELF_HAS_RISCV)
if ("${LIBELF_HAS_RISCV}")
# Turn non-cmake library into a cmake target
add_library(libelf INTERFACE)
target_link_libraries(libelf INTERFACE ${LIBELF_LIBRARY})
target_include_directories(libelf INTERFACE ${LIBELF_INCLUDE_DIR})
message(STATUS "Using system libelf")
else ()
message(STATUS "System libelf does not support RISC-V")
set(LibElf_FOUND FALSE) # Force fallback
endif ()
endif ()
endif ()
endif ()

if ("${WASM}" OR "${FORCE_ELFLIB_STATIC}" OR NOT "${LibElf_FOUND}")
message(STATUS "Using local libelf fallback.")
add_subdirectory("external/libelf")
endif ()
# Always use libelfin (modern C++ ELF library)
message(STATUS "Using libelfin (C++ ELF library)")
add_subdirectory("external/libelfin")

# Detect Qt used qt version
# Based on article https://www.steinzone.de/wordpress/how-to-support-both-qt5-and-qt6-using-cmake/
Expand Down
141 changes: 0 additions & 141 deletions external/libelf/32.fsize.c

This file was deleted.

52 changes: 0 additions & 52 deletions external/libelf/32.getehdr.c

This file was deleted.

52 changes: 0 additions & 52 deletions external/libelf/32.getphdr.c

This file was deleted.

57 changes: 0 additions & 57 deletions external/libelf/32.getshdr.c

This file was deleted.

Loading
Loading