Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pico build size improvements #810

Merged
merged 3 commits into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions 32blit-pico/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_policy(SET CMP0079 NEW) # target_link_libraries() allows use with targets in other directories.

set(CMAKE_C_STANDARD 11)

# Initialise the Pico SDK
Expand All @@ -10,6 +12,12 @@ set(PICO_SDK_VERSION_MAJOR ${PICO_SDK_VERSION_MAJOR} PARENT_SCOPE)
set(PICO_SDK_VERSION_MINOR ${PICO_SDK_VERSION_MINOR} PARENT_SCOPE)
set(PICO_SDK_VERSION_REVISION ${PICO_SDK_VERSION_REVISION} PARENT_SCOPE)

# make sure BlitEngine is built with the right exception flags
target_link_libraries(BlitEngine pico_cxx_options)

# also enable function/data sectons
target_compile_options(BlitEngine PRIVATE -ffunction-sections -fdata-sections)

# driver helper
# can override driver choice by pre-setting BLIT_x_DRIVER
function(blit_driver DRV NAME)
Expand Down Expand Up @@ -133,6 +141,7 @@ endfunction()
function(blit_executable_int_flash NAME SOURCES)
add_executable(${NAME} ${SOURCES} ${ARGN})
target_link_libraries(${NAME} BlitHalPico BlitEngine)
target_link_options(${NAME} PUBLIC -specs=nano.specs -u _printf_float)

pico_enable_stdio_uart(${NAME} 1)
pico_enable_stdio_usb(${NAME} 0)
Expand Down