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 typo where fPIC option is not templated, so it is always enabled #9752

Merged

Conversation

jwillikers
Copy link
Contributor

@jwillikers jwillikers commented Oct 6, 2021

Changelog: Bugfix: The CMakeToolchain generator always sets fPIC enabled due to a typo where the actual parameter is not templated but instead hard-coded as ON.
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one. (N/A)

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Fixes #9753

@CLAassistant
Copy link

CLAassistant commented Oct 6, 2021

CLA assistant check
All committers have signed the CLA.

@jwillikers jwillikers force-pushed the feature/fix-cmaketoolchain-fpic branch from 1e3ae3d to 1972453 Compare October 6, 2021 20:44
@memsharded memsharded self-assigned this Oct 6, 2021
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

This is great, thank you.
The unfortunate thing is that there was a test covering that, but passed because it was testing the empty string, which happen to match the blank space...

We probably want to add this to a potential 1.41.1 if it happens, I will assign to it, and we will see (otherwise 1.42)

@jwillikers
Copy link
Contributor Author

I just added some unit tests, should I fix the original test? I'm not quite sure where it would be.

@memsharded
Copy link
Member

memsharded commented Oct 6, 2021

Beware that one test is broken as it outputs CMAKE_POSITION_INDEPENDENT_CODE: True'. Seems the Python boolean value should be converted to ON

Check the broken tests in https://ci.conan.io/blue/organizations/jenkins/ConanTestSuite/detail/PR-9752/4/pipeline/36

@memsharded memsharded added this to the 1.41.1 milestone Oct 6, 2021
@jwillikers jwillikers requested a review from memsharded October 7, 2021 02:12
@jwillikers
Copy link
Contributor Author

@memsharded Need anything else for this?

@memsharded memsharded modified the milestones: 1.41.1, 1.42 Oct 14, 2021
@memsharded memsharded merged commit 53d06de into conan-io:develop Oct 14, 2021
@memsharded
Copy link
Member

Merging it, to be released in Conan 1.42.

If there is an earlier 1.41.1, I'll backport it, but at the moment, it is not expected.

Thanks very much for contributing this!

memsharded pushed a commit to memsharded/conan that referenced this pull request Oct 22, 2021
…onan-io#9752)

* Fix typo where fPIC option is not templated, so it is always enabled

* Fix typo where fPIC option is not templated, so it is always enabled

* Add name to contributors

* Don't add fPIC functionality when it is not set

* Add unit tests

* Remove extra newlines

* Use "ON" and "OFF" for fPIC value in CMake

* Fix typos

* Correctly setup options for ConanFile Mocks

* Add missing fixture annotations

* Initialize options and default options dictionaries and fix Windows test

* Properly check if the OS is Windows

* Fix more typos

* Make sure to set OS as Windows for unit test ConanFiles

* Revert "Properly check if the OS is Windows"

This reverts commit 7eebbde.
memsharded added a commit that referenced this pull request Oct 25, 2021
…st profile and win_bash (#9755)

* tests that prove bad behavior

* wip

* workaround for win_bash for .bat files

* wip

* wip

* removed printing traceback

* fixing tests

* fixing tests

* fix test

* try fix py27

* wip

* wip

* Update conan/tools/env/environment.py

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>

* Update conan/tools/microsoft/subsystems.py

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>

* Fix unsafe check of the compiler in the CMakeToolchain generator (#9801)

The compiler variable here must not be a NoneType object to use `in`.
This will result in an error when attempting to package a header-only library.
This commit fixes this check.
It first verifies the compiler is not None before checking it.

* Fix typo where fPIC option is not templated, so it is always enabled (#9752)

* Fix typo where fPIC option is not templated, so it is always enabled

* Fix typo where fPIC option is not templated, so it is always enabled

* Add name to contributors

* Don't add fPIC functionality when it is not set

* Add unit tests

* Remove extra newlines

* Use "ON" and "OFF" for fPIC value in CMake

* Fix typos

* Correctly setup options for ConanFile Mocks

* Add missing fixture annotations

* Initialize options and default options dictionaries and fix Windows test

* Properly check if the OS is Windows

* Fix more typos

* Make sure to set OS as Windows for unit test ConanFiles

* Revert "Properly check if the OS is Windows"

This reverts commit 7eebbde.

* rename ConanFileInterface.new_cpp_info (#9800)

* rename ConanFileInterface.new_cpp_info

* wip

* wip

* fix policy=never (#9817)

* Feature: create alias targets (#8533)

* - CMakeDeps: add cmake_target_aliases property

Signed-off-by: SSE4 <[email protected]>

* - automatically deduce an alias target

Signed-off-by: SSE4 <[email protected]>

* Update conans/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_aliases.py

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>

* Update conans/test/functional/toolchains/cmake/cmakedeps/test_cmakedeps_aliases.py

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>

* - add comment

Signed-off-by: SSE4 <[email protected]>

* - use cpp_info instead of new_cpp_info

Signed-off-by: SSE4 <[email protected]>

* - remove useless checks

Signed-off-by: SSE4 <[email protected]>

* - show a warning if target already exists

Signed-off-by: SSE4 <[email protected]>

* - test case for cmake_target_name/cmake_target_namespace

Signed-off-by: SSE4 <[email protected]>

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>

* Fix pkgconfig tests for Windows (#9833)

* Fixed all the tests in Windows

* Added mingw32-g++ tool for Windows

* Get rid of mingw32-g++ specific tool

* Changed appending symbol to overwriting one

* renaming to scope

* more scopes

* fix test

* Update conans/test/integration/toolchains/env/test_virtualenv_winbash.py

Co-authored-by: Carlos Zoido <[email protected]>

Co-authored-by: Luis Martinez de Bartolome Izquierdo <[email protected]>
Co-authored-by: Jordan Williams <[email protected]>
Co-authored-by: SSE4 <[email protected]>
Co-authored-by: Francisco Ramírez <[email protected]>
Co-authored-by: Carlos Zoido <[email protected]>
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.

[bug] CMakeToolchain always enables CMAKE_POSITION_INDEPENDENT_CODE
3 participants