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

Fix add_cmake_flag in cmake helper #4227

Merged
merged 1 commit into from Jan 8, 2019

Conversation

Projects
None yet
3 participants
@blastrock
Copy link
Contributor

commented Jan 4, 2019

Changelog: Bugfix: Fixes a bug in the CMake build helper about how flags are appended
Docs: omit

The description of the add_cmake_flags function does not correspond to the actual behavior.

@CLAassistant

This comment has been minimized.

Copy link

commented Jan 4, 2019

CLA assistant check
All committers have signed the CLA.

@memsharded

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2019

Hi @blastrock

Thanks very much for fixing this, indeed seems a bug. Just two things:

  • Could you please check the CLA link above? It seems you didn't sign it, or you used a different email for the commit than your github user one.

  • If this was a bug, and it went undetected, it is clearly missing a test. Could you please try to provide a test that covers this case? Ask for help, or tell, and we would try to contribute that test, but definitely should be tested.

Thanks again!

@blastrock

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2019

Hi,

I just signed the CLA.

Sorry, I probably won't have time for the test. According to the file (which contains the only usages of the function), the only case where we add two flags (and may thus trigger a bug) is when using parallel build with MSVC, so the test should target that. Also, arch_flag seems to be added twice, not sure if that's intended.

I randomly stumbled upon the latent bug while reading the source and just wanted to report it :)

@memsharded memsharded self-assigned this Jan 8, 2019

@memsharded

This comment has been minimized.

Copy link
Contributor

commented Jan 8, 2019

I happens that it is not possible to force that bug in a test. Fortunately, this shouldn't be affecting anyone. Appending calling add_cmake_flag() never happens, as it is mutually exclusive the case for parallel + VS and the case of arch (-mXX, by gcc, clang).

So I am merging it now, as it is an improvement anyway that could protect in the future. Thanks!

@lasote, if this is not actually used, should we refactor it?

@memsharded memsharded merged commit 7f239e1 into conan-io:develop Jan 8, 2019

2 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details

@ghost ghost removed the stage: review label Jan 8, 2019

@memsharded memsharded referenced this pull request Jan 8, 2019

Merged

refactor cmake flags #4241

NoWiseMan added a commit to NoWiseMan/conan that referenced this pull request Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.