pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Script to build all_headers

Open lurch opened this issue 4 years ago • 1 comments

Inspired by my comment here: https://github.com/raspberrypi/pico-sdk/pull/316/files#r608219018

I dunno how to plumb this into the CMake infrastructure, but hopefully @kilograham can sort out that part :wink: (I wrote it in Python instead of a shell-script, so that it should work on Windows as well)

I used it to (locally) create test/kitchen_sink/all_pico_headers.h and then changed test/kitchen_sink/kitchen_sink.c to just:

#include <stdio.h>
// Include all headers to check for compiler warnings
#include "all_pico_headers.h"

and kitchen_sink builds fine :grin:

I dunno why I had to exclude pico_mem_ops though? If I don't exclude it, the compiler tells me

[ 45%] Building C object test/kitchen_sink/CMakeFiles/kitchen_sink.dir/kitchen_sink.c.obj
In file included from /home/andrew/github/raspberrypi/databooks/pico-sdk/test/kitchen_sink/kitchen_sink.c:9:0:
/home/andrew/github/raspberrypi/databooks/pico-sdk/test/kitchen_sink/all_pico_headers.h:210:26: fatal error: pico/mem_ops.h: No such file or directory
 #include "pico/mem_ops.h"
                          ^
compilation terminated.

which is weird, as https://github.com/raspberrypi/pico-sdk/blob/master/test/kitchen_sink/CMakeLists.txt does seem to be pulling in pico_mem_ops ?

lurch avatar Apr 07 '21 09:04 lurch

kitchen_sink also still builds cleanly if I change test/kitchen_sink/kitchen_sink.c to do:

#include <stdio.h>
// Include all headers to check for compiler warnings
#include "all_pico_headers.h"
// Include a second time to check that include-guards are working
#include "all_pico_headers.h"

:slightly_smiling_face:

lurch avatar Apr 07 '21 10:04 lurch

oldest PR, so i thought i'd merge!

kilograham avatar May 19 '24 22:05 kilograham