CMake building and Initial REL(A) support#37
CMake building and Initial REL(A) support#37deadly-platypus wants to merge 9 commits intoaclements:masterfrom
Conversation
|
I think CMake, reformatting code, and adding rels should be separate pull requests. |
|
Any suggestion as to how to do that? |
|
Hi @deadly-platypus . Unfortunately, with all of the code reformatting I can't really review or submit this. Please just follow the style of the existing code, which should be pretty consistent (though I didn't run a formatting tool, so I'm sure there are minor inconsistencies). I'm curious about the CMake support you added, since this is the second PR to propose that. What's the benefit of adding CMake support? Make is certainly not the best thing in the world, but the existing makefiles work and are pretty simple. (I've never used CMake myself, so perhaps the answer is obvious to someone more familiar with it.) |
|
I totally understand rejecting this PR for the formatting. I'll try to fix that soon. Cmake is used to generate a build system, be it make files, Visual Studio... Whatever they use...., Ninja files, or others. It thus makes it easy to integrate other repos into existing projects as git submodules. So to add this repo as a dependency for my project, I as it as a submodule, and then add two lines to the CMakeLists.txt file. One line is to tell CMake about the directory, and one line to add the build target as a dependency. CMake then ensures that libelfin is built before my code, and I don't need to know how your code is built because CMake will generate the correct build system for everything. IMO it's a pretty slick system for better cross platform integration and usability. |
|
@aclements @deadly-platypus If you're open to adding a cmake script upstream, then we don't have to maintain one ourselves. |
merge manuale senza riformattazioni da aclements#37, fino a commit (incluso) "changing elf lib domain model, and adding some stubs "
I needed to at least be able to get relocation entries for my work, so I quickly added that by adding two new methods of the
sectionclass,get_relsandget_relas. Both return astd::vectorof a newstruct Elf_Relorstruct Elf_Relainstances. Additionally, I added CMake support, including the creation of theto_string.ccfiles in both thedwarfandelfdirectories. This PR only builds the libraries in those directories, with targets for the shared and static libraries. So the tests or examples still need work.Now comes the bad part. I had my IDE reformat all the code, which created a large diff. You can take it as is, or let me know what styling you use, and I can update this PR. Or, you know, you could just say no to it all.