Skip to content

Commit

Permalink
use the system's patchelf executable if it is installed already
Browse files Browse the repository at this point in the history
We aim to reduce the number of code that is downloaded from third-party
sources during the build process.

Signed-off-by: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
  • Loading branch information
FelixSchwarz committed Oct 24, 2023
1 parent 6e89718 commit 36aa38b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,21 @@ else()
message(STATUS "Set ${AIMET_PYTHONPATH} in ${CMAKE_CURRENT_SOURCE_DIR}")
endif()

# FIXME
# Better to include patchefl into docker image, although seems it is not trivial
include(FetchContent)
FetchContent_Declare(patchelf
URL "https://github.com/NixOS/patchelf/releases/download/0.15.0/patchelf-0.15.0-x86_64.tar.gz"
)
if(NOT patchelf_POPULATED)
FetchContent_Populate(patchelf)
set(PATCHELF_EXE ${patchelf_SOURCE_DIR}/bin/patchelf)
message(STATUS "patchelf: ${PATCHELF_EXE}")
find_program(PATCHELF_EXE patchelf)
if (PATCHELF_EXE)
message(STATUS "Found patchelf in '${PATCHELF_EXE}'")
else()
# FIXME
# Better to include patchefl into docker image, although seems it is not trivial
include(FetchContent)
FetchContent_Declare(patchelf
URL "https://github.com/NixOS/patchelf/releases/download/0.15.0/patchelf-0.15.0-x86_64.tar.gz"
)
if(NOT patchelf_POPULATED)
FetchContent_Populate(patchelf)
set(PATCHELF_EXE ${patchelf_SOURCE_DIR}/bin/patchelf)
message(STATUS "patchelf: ${PATCHELF_EXE}")
endif()
endif()

# -------------------------------
Expand Down

0 comments on commit 36aa38b

Please sign in to comment.