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

cmake-toolchain: set CMAKE_SYSTEM_PROCESSOR in Apple block #10434

Closed

Conversation

theodelrieu
Copy link
Contributor

Hello,

CMAKE_SYSTEM_PROCESSOR is not set by CMakeToolchain when building on Apple, I'm not sure if this is the right place to set it.

It is mentioned in GenericSystemBlock, but after debugging a bit, the values returned by self._get_cross_build() are all None.

  • 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.

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.

Are you sure that using different architecture for host and build profiles it was not defined? I am concerned that this can conflict with the GenericSystemBlock one in some cases.

Also a bit more detailed why/when this is needed, problems that it is solving, etc. So far we have apple OSX, iOS and M1 cross-builds in our testing, and all seems to be working fine.

It would also be needed at least some unit testing. We can help with that once the problem and scope is clear.

@theodelrieu
Copy link
Contributor Author

Also a bit more detailed why/when this is needed, problems that it is solving, etc.

We have a library that checks CMAKE_SYSTEM_PROCESSOR to determine if thread_local should be used or not (CMake has cxx_feature stuff, but thread_local detection is buggy).

When cross-building for 32-bit x86 simulator, the library did define thread_local, which is not supported on this platform. I realised that CMAKE_SYSTEM_PROCESSOR was empty.

I am concerned that this can conflict with the GenericSystemBlock one in some cases.

True, I guess finding out why _get_cross_build returns empty values would be a cleaner way to tackle the problem 😅

@czoido czoido self-assigned this Feb 17, 2022
@czoido czoido added this to the 2.0.0-alpha5 milestone Feb 17, 2022
@memsharded memsharded modified the milestones: 2.0.0-alpha5, 2.0.0-alpha6 Mar 7, 2022
@memsharded memsharded modified the milestones: 2.0.0-alpha6, 1.47 Mar 25, 2022
@memsharded
Copy link
Member

Superseded by #10856, which is targeted for next 1.47.
Thanks very much for raising this!

@memsharded memsharded closed this Mar 30, 2022
@czoido czoido removed this from the 1.47 milestone Mar 30, 2022
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