diff options
author | Brad King <brad.king@kitware.com> | 2022-01-12 14:45:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-12 14:45:07 (GMT) |
commit | d0096227694dc1dab376d0cbf8e89fa92bbfc71d (patch) | |
tree | f18c60bb5439ab3ac26ef342360f4644608cb0c6 /Source/cmFileCommand.cxx | |
parent | c7af95477038cdf90b8ebfeb2ac0beae14aff5d9 (diff) | |
parent | 41bebbe50a66dfe7bb32365bd119e7e679d0faf1 (diff) | |
download | CMake-d0096227694dc1dab376d0cbf8e89fa92bbfc71d.zip CMake-d0096227694dc1dab376d0cbf8e89fa92bbfc71d.tar.gz CMake-d0096227694dc1dab376d0cbf8e89fa92bbfc71d.tar.bz2 |
Merge topic 'file-READ_ELF-capture-error'
41bebbe50a file: Restore error capture in undocumented READ_ELF mode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6853
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r-- | Source/cmFileCommand.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 2cce400..d9fb608 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1211,9 +1211,14 @@ bool HandleReadElfCommand(std::vector<std::string> const& args, 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.Error.empty()) { + status.SetError(cmStrCat("READ_ELF given FILE:\n ", fileNameArg, + "\nthat is not a valid ELF file.")); + return false; + } + status.GetMakefile().AddDefinition(arguments.Error, + "not a valid ELF file"); + return true; } if (!arguments.RPath.empty()) { |