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. ```
Showing
- Source/CMakeLists.txt 2 additions, 30 deletionsSource/CMakeLists.txt
- Source/cmELF.cxx 5 additions, 60 deletionsSource/cmELF.cxx
- Tests/RunCMake/CMakeLists.txt 2 additions, 2 deletionsTests/RunCMake/CMakeLists.txt
- Tests/RunCMake/file-RPATH/RunCMakeTest.cmake 1 addition, 1 deletionTests/RunCMake/file-RPATH/RunCMakeTest.cmake
Loading
Please register or sign in to comment