Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All of the .h files in the build are can be removed #5

Open
UppaJung opened this issue Apr 2, 2020 · 2 comments · May be fixed by #27
Open

All of the .h files in the build are can be removed #5

UppaJung opened this issue Apr 2, 2020 · 2 comments · May be fixed by #27
Labels
enhancement New feature or request

Comments

@UppaJung
Copy link

UppaJung commented Apr 2, 2020

In a fork of the CMakeLists.txt file used to build the library, I removed all the .h files with no ill effect.

I believe the compiler only needs to know about the .c files to compile, not the headers. This cuts the file size in half and should make it simpler to maintain.

@robinlinden
Copy link
Owner

I used find -name *.c -or -name *.h libsodium (or something similar) to find all files, so creating the lists isn't a big deal, but I agree that it's pretty cluttered.

The reason for adding them like that is to help some IDEs (Visual Studio) find the headers for autocomplete and things like that.

Depending on the CMake version, generators, and options in libsodium you want to support, you could even use file(GLOB_RECURSE SRCS libsodium/*.c CONFIGURE_DEPENDS) to set the entire build tree up as a one-liner and not have to change it when updating libsodium.

Long-term, I might remove the headers, especially as VS's built-in CMake support gets better, but for now they get to stay since I don't think it's much of a maintenance burden.

@robinlinden robinlinden added the enhancement New feature or request label Apr 2, 2020
@robinlinden
Copy link
Owner

I've thought some more about it, and I'm not at all attached to having the headers there to support VS. I'll nuke them. 😁 Good suggestion!

CPunch added a commit to CPunch/libsodium-cmake that referenced this issue Dec 31, 2023
@CPunch CPunch linked a pull request Dec 31, 2023 that will close this issue
CPunch added a commit to CPunch/libsodium-cmake that referenced this issue Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants