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

Fixes (most) -Wall and -Wextra warnings #93

Merged
merged 12 commits into from
Jan 10, 2024
Merged

Conversation

jcelerier
Copy link
Member

@lilggamegenius there were a lot of build errors with the PR actually ^^' let's put the work to fix them here

@jcelerier
Copy link
Member Author

hmm and I'm still getting -Werror leaking in downstream projects, investigating why...

lilggamegenius and others added 10 commits January 10, 2024 12:24
Doesn't fix cmidi2.hpp since that's external.

Signed-off-by: Gabe Gonzalez II <[email protected]>
Mostly more of the same of the previous commit.
Also removes a few missed checks for LIBREMIDI_HAS_SPAN since C++20 is the minimum now.

Signed-off-by: Gabe Gonzalez II <[email protected]>
@jcelerier
Copy link
Member Author

okay, problems can come up if the user has some additional warnings - e.g. I have -Wnon-virtual-dtor in a downstream project as CMAKE_CXX_FLAGS and thus this breaks the build. I'm going to enable Werror only during CI this way it won't break randomly for users.

@jcelerier jcelerier merged commit b5ef80a into master Jan 10, 2024
56 checks passed
@lilggamegenius
Copy link
Contributor

I think I may have figured out why the warnings are leaking through downstream. I think it might be this in the cmake file

target_include_directories(libremidi ${_public}
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include>
)

Specifically, I think before ${_public}, It needs to have SYSTEM to tell cmake to mark the includes as system directories so that warnings are suppressed when used downstream. You could add a new _system variable that gets set to SYSTEM normally, but is empty for CI.
I haven't tested this yet but I managed to get it working by doing this which is basically the downstream side way of doing this.

@lilggamegenius
Copy link
Contributor

The other target_include_directories should probably also have SYSTEM added, but not using the _system variable since those are actual external dependencies.

@jcelerier jcelerier deleted the wip/warning-fixes branch March 9, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants