diff options
author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2021-06-17 14:22:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-24 14:57:51 (GMT) |
commit | 115ff6a347a96eb77abcd8df5e72e4851dcea414 (patch) | |
tree | 925a33815ef6168c56eeec955ac4f356256ddf64 /Source/cmFileCommand.cxx | |
parent | 5dfa3ddbe592add43e2985dad772f6aa44d37c0b (diff) | |
download | CMake-115ff6a347a96eb77abcd8df5e72e4851dcea414.zip CMake-115ff6a347a96eb77abcd8df5e72e4851dcea414.tar.gz CMake-115ff6a347a96eb77abcd8df5e72e4851dcea414.tar.bz2 |
cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 0ad59c7..1e3076f 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -31,6 +31,7 @@ #include "cmArgumentParser.h" #include "cmCMakePath.h" #include "cmCryptoHash.h" +#include "cmELF.h" #include "cmExecutionStatus.h" #include "cmFSPermissions.h" #include "cmFileCopier.h" @@ -64,10 +65,6 @@ # include "cmFileLockResult.h" #endif -#if defined(CMake_USE_ELF_PARSER) -# include "cmELF.h" -#endif - #if defined(_WIN32) # include <windows.h> #endif @@ -1242,8 +1239,12 @@ bool HandleReadElfCommand(std::vector<std::string> const& args, return false; } -#if defined(CMake_USE_ELF_PARSER) cmELF elf(fileNameArg.c_str()); + if (!elf) { + status.SetError(cmStrCat("READ_ELF given FILE \"", fileNameArg, + "\" that is not a valid ELF file.")); + return false; + } if (!arguments.RPath.empty()) { if (cmELF::StringEntry const* se_rpath = elf.GetRPath()) { @@ -1261,15 +1262,6 @@ bool HandleReadElfCommand(std::vector<std::string> const& args, } return true; -#else - std::string error = "ELF parser not available on this platform."; - if (arguments.Error.empty()) { - status.SetError(error); - return false; - } - status.GetMakefile().AddDefinition(arguments.Error, error); - return true; -#endif } bool HandleInstallCommand(std::vector<std::string> const& args, |