-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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] check present "CPU" variable on PrepareEnv, if empty use CMAKE_SYSTEM_PROCESSOR #16547
Conversation
Just tested this. What a simple solution that will save so much time. Thanks! Maybe just add a comment so everyone knows why it’s there! |
…E_SYSTEM_PROCESSOR
dd8b489
to
f75cead
Compare
@AlwinEsch can this be backported to Leia? |
Or I can do it if you don’t have the time? |
Better you do 😄, my car died yesterday and need to go around (by rental car) to buy a new 😡 |
Sure, happy to. Sorry to hear about your car! |
The coorect fix would have been to set CMAKE_SYSTEM_PROCESSOR in Toolchain(_binaddons).cmake and then use that variable instead of CPU in PrepareEnv.cmake. |
So as CMAKE_SYSTEM_PROCESSOR is already set, we could have just substituted CPU with CMAKE_SYSTEM_PROCESSOR for OSX is what you are saying? Or is there a reason is explicitly set it in Toolchain(_binaddons).cmake? |
CMake auto detects |
Ok, that makes sense. I'm not the best person to make this change due to my novice cmake skills ;) Once the correct change is in place I'm happy to test and backport it. |
the change as is is not wrong either. Both work |
Yes it works too, but this PR allows to build add-ons for osx native and not via 'cross-compiling'. |
Then that’s the solution we should move towards. @AlwinEsch when you have time for a follow up PR let me know. |
Description
This is necessary to addons outside of "./tools/depends" to e.g. Mac to build because the variable "CPU" can only be given from there at the addon construction.
This is OK for cross platform addon construction like iOS or Android, but very cumbersome for building an addon to the same system (for testing purposes).
This is added:
Without comes:
With:
Motivation and Context
How Has This Been Tested?
Addon on Mac by:
Screenshots (if appropriate):
Types of change
Checklist: