Browse Source

file(GET_RUNTIME_DEPENDENCIES): Use cmELF unconditionally

Starting with CMake 3.22, cmELF.h is always available, so use it
unconditionally.
Kyle Edwards 4 years ago
parent
commit
5aeda18297
1 changed files with 1 additions and 10 deletions
  1. 1 10
      Source/cmBinUtilsLinuxELFLinker.cxx

+ 1 - 10
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
 }
 }