Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4899

SDK • cmake: Mixed host based and RP2040 project...

$
0
0
Hi,

I'm trying to add a host native tool to my rp2040 project, this is a host based binary that does some stuff over the network to talk to my (network enabled) rp2040 board.

I'd like to have a single "project" that builds both the tool as well as the main rp2040 project as there is a shared include file (which defines the packet structure) and it seems like a cleaner approach.

My naive thoughts were to move my main project into a subdirectory, have the tool in another subdirectory and then having a simple top level CMakeLists.txt file which just "add_subdirectory()" for both the directories.

However, if I don't include the pico_sdk_import.include in that top level CMakelists.txt file then it seems to ignore the one in my subdirectory CMakeLists.txt and tries to build the rp2040 project using the native compiler.

If I do include the pico_sdk_import.include then my rp2040 code builds fine, but it then tries to build the tool using the arm compiler!

I've had a look at the pioasm stuff (as it's a similar use case) but I don't really understand it.

Any pointers?

Thanks.

Statistics: Posted by essele — Sat Mar 30, 2024 11:36 am



Viewing all articles
Browse latest Browse all 4899

Trending Articles