summaryrefslogtreecommitdiffstats
path: root/Source/cmBinUtilsLinuxELFLinker.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-07-12 19:40:37 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-07-12 20:12:52 (GMT)
commit5aeda18297222c2a0c9e5b067adc1d0d736a78bf (patch)
tree8da1913c7f3a6cd8bc8cb120a08f6d8a79cb50a6 /Source/cmBinUtilsLinuxELFLinker.cxx
parent17aa96bb7a6cf16cce1c9bd81dd54b2784826e7d (diff)
downloadCMake-5aeda18297222c2a0c9e5b067adc1d0d736a78bf.zip
CMake-5aeda18297222c2a0c9e5b067adc1d0d736a78bf.tar.gz
CMake-5aeda18297222c2a0c9e5b067adc1d0d736a78bf.tar.bz2
file(GET_RUNTIME_DEPENDENCIES): Use cmELF unconditionally
Starting with CMake 3.22, cmELF.h is always available, so use it unconditionally.
Diffstat (limited to 'Source/cmBinUtilsLinuxELFLinker.cxx')
-rw-r--r--Source/cmBinUtilsLinuxELFLinker.cxx11
1 files changed, 1 insertions, 10 deletions
diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx
index 99707a3..a69c00d 100644
--- a/Source/cmBinUtilsLinuxELFLinker.cxx
+++ b/Source/cmBinUtilsLinuxELFLinker.cxx
@@ -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
}
}