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

Added flags to cmakelists in test project to treat all warnings as errors #1900

Conversation

jmoore91
Copy link

Refer to #1798

Changes on test/CMakeLists.txt to always use -Wall, -Werror on GCC/Clang and the /WX, /W4 flags on MSVC.

Fixed build issue for GCC
Fixed build issues for Clang

@coveralls
Copy link

coveralls commented Jan 12, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 393345c on jmoore91:feature/build_tests_with_warnings_as_errors into bde5712 on nlohmann:develop.

Comment on lines 152 to 156
if(MSVC)
target_compile_options(${testcase} PRIVATE /W4 /WX)
else()
target_compile_options(${testcase} PRIVATE -Wall -Wextra -pedantic -Werror)
endif()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the previous target_compile_options is using cmake generator expression syntax, might be good to add generator expression here too.

How about?

target_compile_options(${testcase} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic -Werror>>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, yeah probably a good idea. I will change that!

@nlohmann
Copy link
Owner

Any idea why the AppVeyor build is failing?

Copy link
Author

@jmoore91 jmoore91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why the AppVeyor build is failing?

Yeah looks like I missed a single warning

unit-allocator.cpp(108): warning C4100: 'p': unreferenced formal parameter

Should hopefully be easy enough to fix. Not sure why its only a single VS 2015 build failing on this one however...

@bhardwajs
Copy link

bhardwajs commented Jan 24, 2020

Should hopefully be easy enough to fix. Not sure why its only a single VS 2015 build failing on this one however...

Do you have links I can look at to see success for VS 2017 or 2019? It's possible that it's being compiled away in newer compilers. Will love to look. Thanks!

@stale
Copy link

stale bot commented Feb 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Feb 27, 2020
@dota17
Copy link
Contributor

dota17 commented Feb 27, 2020

Keep Alive.
What is the current state? Is it ready for merging?

@stale stale bot removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Feb 27, 2020
@t-b
Copy link
Contributor

t-b commented Feb 27, 2020

@nlohmann
Copy link
Owner

I restarted the failing CIs. Let's see if they succeed now. Unless the build is green, we cannot merge.

@stale
Copy link

stale bot commented Apr 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Apr 12, 2020
@nlohmann
Copy link
Owner

Can you please update to the latest develop branch - there have been several fixes with respect to the CI.

@stale stale bot removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Apr 13, 2020
@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label May 13, 2020
@nlohmann nlohmann closed this May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants