mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
file(GET_RUNTIME_DEPENDENCIES): Use cmELF unconditionally
Starting with CMake 3.22, cmELF.h is always available, so use it unconditionally.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <cmsys/RegularExpression.hxx>
|
||||
|
||||
#include "cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.h"
|
||||
#include "cmELF.h"
|
||||
#include "cmLDConfigLDConfigTool.h"
|
||||
#include "cmMakefile.h"
|
||||
#include "cmMessageType.h"
|
||||
@@ -18,10 +19,6 @@
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
|
||||
#ifdef CMake_USE_ELF_PARSER
|
||||
# include "cmELF.h"
|
||||
#endif
|
||||
|
||||
static std::string ReplaceOrigin(const std::string& rpath,
|
||||
const std::string& origin)
|
||||
{
|
||||
@@ -91,7 +88,6 @@ bool cmBinUtilsLinuxELFLinker::ScanDependencies(
|
||||
{
|
||||
std::vector<std::string> parentRpaths;
|
||||
|
||||
#ifdef CMake_USE_ELF_PARSER
|
||||
cmELF elf(file.c_str());
|
||||
if (!elf) {
|
||||
return false;
|
||||
@@ -106,7 +102,6 @@ bool cmBinUtilsLinuxELFLinker::ScanDependencies(
|
||||
this->Machine = elf.GetMachine();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return this->ScanDependencies(file, parentRpaths);
|
||||
}
|
||||
@@ -175,15 +170,11 @@ bool cmBinUtilsLinuxELFLinker::ScanDependencies(
|
||||
namespace {
|
||||
bool FileHasArchitecture(const char* filename, std::uint16_t machine)
|
||||
{
|
||||
#ifdef CMake_USE_ELF_PARSER
|
||||
cmELF elf(filename);
|
||||
if (!elf) {
|
||||
return false;
|
||||
}
|
||||
return machine == 0 || machine == elf.GetMachine();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user