-
Notifications
You must be signed in to change notification settings - Fork 69
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
Allow building for pico by specifying a toolchain, same as 32blit #714
Conversation
To build a project for pico just do: cmake -DCMAKE_TOOLCHAIN_FILE=../../32blit-sdk/pico.toolchain .. You may optionally override PICO_BOARD and PICO_SDK_PATH
Guessing this will blow up the checks. This allows games to be built for picosystem without having to include extra stuff in their local CMakeLists.txt. It works exactly the same as 32blit.toolchain, although the contents is very different. |
How it works:
|
# Look for includes and libraries only in the target system prefix. | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also commented this line because it prevents the 32blit-sdk from being found. This is the same as the problem with emscripten.
Hmm, hopefully the Pico SDK doesn't change in a way that breaks this... I guess this is more how CMake is supposed to be used, but also not how the Pico SDK wants you to use it 🤷 Anyway, having to do less special stuff for one platform is nice and this didn't appear to break the old setup. |
I think the only reason this works for CI is because they have include guards on everything. So it will all get included multiple times if you do it the recommended way, but it is still in mostly the right order. It probably will break, that's why this is a draft. Maybe we could add it as a submodule or use FetchContent to get a specific revision. (If we do that we can also hard code the path without worrying about it. Currently this will give a weird error if the SDK isn't where I've hard coded it to be, and you don't know to override that.) |
I've tested this on hardware now and it seems to work fine. |
Thank you! This definitely feels more consistent, even if it might spontaneously explode. (maybe?) |
To build a project for pico just do:
You may optionally override PICO_BOARD and PICO_SDK_PATH