pico-embedded-swift
                                
                                
                                
                                    pico-embedded-swift copied to clipboard
                            
                            
                            
                        Add linux compatibility
This pull request changes the CMakeLists.txt to be compatible with Linux (wip)
- [x] Add location of 
swiftc - [x] dynamically find 
swiftclocation using something likewhich swiftc - [ ] Use correct target (apparently it is different)
 - [ ] Find out if libraries are compatible
 - [ ] Change README to include installation instructions
 
@libewa Thank you so much for working on this! Unbeknownst to you I had also started on adding Linux support, but I hadn't pushed it yet (sorry!) and it's also not completely finished (e.g. I still need to update the readme).
I just posted a draft PR (#2) with my approach. Maybe we can find a way to take the best parts from both our branches to bring this over the finish line. As far as I can tell, my approach uses fewer platform conditionals (if (APPLE)) because I took the liberty to make a few more changes: I don't think we really need to look at the TOOLCHAINS env var on macOS and it's easier to understand if we ask the user to pass in the path to swiftc directly. What do you think?
I'm surprised you're seeing that you need to use a different target on Linux. I didn't see this in my testing. I'm testing with Docker from my Mac (I don't have a Linux machine) with a Ubuntu 22.04 Swift nightly image (swiftlang/swift:nightly-jammy).
The problem really is that my two Linux computers run Raspbian and NixOS. NixOS doesn't have the armv7 cc, and Raspbian (with the gcc-arm-none-eabi package) apparently uses armv6-none-eabi. At least it didn't crash with that target, and failed on building the Pico SDK instead.
@libewa I'm sorry to leave you hanging so long, totally my bad. I'm going to close this now because I'm a very bad maintainer (which I should have made clear from the start). I'm sorry, and thank you for taking the time to contribute.