diff options
author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2021-06-23 08:24:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-24 14:57:51 (GMT) |
commit | 5dfa3ddbe592add43e2985dad772f6aa44d37c0b (patch) | |
tree | 0e49df76386e2c3399e6f34ecefc8ad35dd718d5 /Tests/RunCMake/CMakeLists.txt | |
parent | 0da1540aaa8d36145329572938aeec6c86fb1ee7 (diff) | |
download | CMake-5dfa3ddbe592add43e2985dad772f6aa44d37c0b.zip CMake-5dfa3ddbe592add43e2985dad772f6aa44d37c0b.tar.gz CMake-5dfa3ddbe592add43e2985dad772f6aa44d37c0b.tar.bz2 |
cmELF: Allow building without system ELF headers
Use ELF headers vendored in `Utilities/cmelf` to get the ELF constants
and types. Using the same ELF definition header for all compilation
targets allows removing some #ifdefs depending on the host OS since we
know all required ELF constants will always be present. To reduce the
size of this commit, the CMake_USE_ELF_PARSER definite will be removed
in a separate commit.
This allows me to use CMAKE_BUILD_WITH_INSTALL_RPATH=False and the Ninja
generator on macOS, whereas before it would always give me the following
error message (despite cross-compiling for an ELF-based platform):
```
The install of the <name> target requires changing an RPATH from
the build tree, but this is not supported with the Ninja generator unless
on an ELF-based platform. The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
be set to avoid this relinking step.
```
Diffstat (limited to 'Tests/RunCMake/CMakeLists.txt')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index dafb174..256c8a6 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -377,8 +377,8 @@ add_RunCMake_test(ctest_upload) add_RunCMake_test(ctest_fixtures) add_RunCMake_test(file -DMSYS=${MSYS}) add_RunCMake_test(file-CHMOD -DMSYS=${MSYS}) -if(HAVE_ELF_H OR CMAKE_SYSTEM_NAME STREQUAL "AIX") - add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DHAVE_ELF_H=${HAVE_ELF_H}) +if(CMake_USE_ELF_PARSER) + add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCMake_USE_ELF_PARSER=${CMake_USE_ELF_PARSER}) endif() add_RunCMake_test(find_file) add_RunCMake_test(find_library -DCYGWIN=${CYGWIN} -DMSYS=${MSYS}) |