Rework build targets to mirror libraries as _headers versions, and fix dependency issues #1211

Merged
kilograham merged 1 commit from build_targets_consistency into develop 2023-01-30 10:56:03 -06:00
kilograham commented 2023-01-29 13:06:51 -06:00 (Migrated from github.com)

Rework build targets such that:

  1. Pico SDK libraries now have the correct dependencies on other SDK libraries
  2. Pico SDK libraries all have _headers variants to include the just headers. This may facilitate building user STATIC libraries without pulling in SDK code, though care will still need to be taken w.r.t. values of #defines
  3. Make sure the _headers versions also have the correct dependencies

Note: There are a few exceptions to 1. for some non code libraries like pico_standard_link and pico_cxx_options

Rework build targets such that: 1. Pico SDK libraries now have the correct dependencies on other SDK libraries 2. Pico SDK libraries all have _headers variants to include the just headers. This may facilitate building user STATIC libraries without pulling in SDK code, though care will still need to be taken w.r.t. values of #defines 3. Make sure the _headers versions also have the correct dependencies Note: There are a few exceptions to 1. for some non code libraries like pico_standard_link and pico_cxx_options
peterharperuk (Migrated from github.com) approved these changes 2023-01-29 14:52:10 -06:00
peterharperuk (Migrated from github.com) left a comment

Some questions, but basically looks ok

Some questions, but basically looks ok
@ -80,13 +119,17 @@ macro(pico_simple_hardware_headers_only_target NAME)
# super interesting except to determine functionality as they are mostly passive accessors, however
peterharperuk (Migrated from github.com) commented 2023-01-29 14:01:34 -06:00

You might have to explain to me what these LIB_* defs are for

You might have to explain to me what these LIB_* defs are for
peterharperuk (Migrated from github.com) commented 2023-01-29 14:26:23 -06:00

Should this be hardware_structs_headers? See other examples

Should this be hardware_structs_headers? See other examples
peterharperuk (Migrated from github.com) commented 2023-01-29 14:26:48 -06:00

Should this be hardware_structs_headers?

Should this be hardware_structs_headers?
lurch commented 2023-01-29 15:04:03 -06:00 (Migrated from github.com)

Apologies for the stupid question, but is this all "internal to pico-sdk only", i.e. it has no impact on anybody using the SDK in their projects?

Apologies for the stupid question, but is this all "internal to pico-sdk only", i.e. it has no impact on anybody _using_ the SDK in their projects?
kilograham (Migrated from github.com) reviewed 2023-01-29 16:52:47 -06:00
@ -80,13 +119,17 @@ macro(pico_simple_hardware_headers_only_target NAME)
# super interesting except to determine functionality as they are mostly passive accessors, however
kilograham (Migrated from github.com) commented 2023-01-29 16:52:47 -06:00

The idea was to allow inter-dependent libraries to be aware of each other, and to change/add behavior or guard includes

so you can do

#if LIB_PICO_FOO
#include "pico/foo.h"
#endif

as well - you can search on them; they are using a lot in the stdio stuff and with some of the swapable libraries. I'm kind of leaning in favor of making these more explicit than implicit, and thus have also started adding the new NOFLAG option to avoid setting them... of course it is hard to know who has taken advantage of them, but probably few if any beyond SDK and examples/extras/playground

Note: you might think (as did I) the the LIB_ flag therefore belongs on the header, however in practice we only check them in the C files

The idea was to allow inter-dependent libraries to be aware of each other, and to change/add behavior or guard includes so you can do ``` #if LIB_PICO_FOO #include "pico/foo.h" #endif ``` as well - you can search on them; they are using a lot in the `stdio` stuff and with some of the swapable libraries. I'm kind of leaning in favor of making these more explicit than implicit, and thus have also started adding the new `NOFLAG` option to avoid setting them... of course it is hard to know who has taken advantage of them, but probably few if any beyond SDK and examples/extras/playground Note: you might think (as did I) the the LIB_ flag therefore belongs on the header, however in practice we only check them in the C files
kilograham (Migrated from github.com) reviewed 2023-01-29 16:53:13 -06:00
kilograham (Migrated from github.com) commented 2023-01-29 16:53:12 -06:00

yeah, i almost did - the libraries are identical (i.e. it is a headers only library already)

yeah, i almost did - the libraries are identical (i.e. it is a headers only library already)
kilograham commented 2023-01-29 16:54:08 -06:00 (Migrated from github.com)

Apologies for the stupid question, but is this all "internal to pico-sdk only", i.e. it has no impact on anybody using the SDK in their projects?

The intention is for it to have no (negative) impact

> Apologies for the stupid question, but is this all "internal to pico-sdk only", i.e. it has no impact on anybody _using_ the SDK in their projects? The intention is for it to have no (negative) impact
peterharperuk commented 2023-01-30 10:47:13 -06:00 (Migrated from github.com)

I approve of this.

I approve of this.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!1211
No description provided.