Skip to content

Change pico_low_power CMakeLists.txt target_include_directories to use _headers - #3287

Open
Richard-CRT wants to merge 1 commit into
raspberrypi:developfrom
Richard-CRT:pico_low_power_headers
Open

Richard-CRT wants to merge 1 commit into
raspberrypi:developfrom
Richard-CRT:pico_low_power_headers

Conversation

@Richard-CRT

Copy link
Copy Markdown

Fixes #3286

Title, causing static libraries that link PRIVATE headers using the _headers suffixes e.g.

target_link_libraries(static_library_target PRIVATE
    pico_stdlib_headers
    pico_aon_timer_headers
    pico_rand_headers
    pico_low_power_headers
    pico_flash_headers
    pico_double_headers
    hardware_spi_headers
    hardware_powman_headers
    hardware_sync_headers
    hardware_watchdog_headers
    hardware_flash_headers
    hardware_adc_headers
)

To cause fatal error: pico/low_power.h: No such file or directory .

Problem:

target_include_directories(pico_low_power INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

Compare to below examples:

pico_rand
target_include_directories(pico_rand_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

pico_flash
target_include_directories(pico_flash_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

Solution:

Add _headers on line 7 of src/rp2_common/pico_low_power/CMakeLists.txt to result in

target_include_directories(pico_low_power_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

This matches pico_rand and pico_flash etc behaviour, where headers
are available via _headers suffix

@will-v-pi will-v-pi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants