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
Merged

Fix add_cmake_flag in cmake helper #4227

merged 1 commit into from Jan 8, 2019

Conversation

blastrock
Copy link
Contributor

@blastrock blastrock 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
Copy link

CLAassistant commented Jan 4, 2019

CLA assistant check
All committers have signed the CLA.

@memsharded
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Member

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
@ghost ghost removed the stage: review label Jan 8, 2019
@memsharded memsharded mentioned this pull request Jan 8, 2019
NoWiseMan pushed 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants