Skip to content

Commit

Permalink
Merge pull request #11 from egorse/wip
Browse files Browse the repository at this point in the history
Add build for linux host
  • Loading branch information
xrip authored Nov 28, 2023
2 parents 28eca42 + ea4e96b commit 7b1fda7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
run: |
sudo apt update && \
sudo apt install -y git python3 && \
sudo apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libusb-1.0-0-dev
sudo apt install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libusb-1.0-0-dev && \
sudo apt install -y ninja-build
- name: Check out this repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -70,15 +71,23 @@ jobs:
cd picotool/ && \
mkdir build && \
cd build && \
cmake .. && \
make
cmake -G Ninja .. && \
cmake --build .
- name: Build the project
run: |
export PICO_SDK_PATH=$HOME/pico-sdk && \
mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DOVERCLOCKING=366 .. && \
make
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DOVERCLOCKING=366 .. && \
cmake --build .
- name: Build for linux host
run: |
sudo apt install -y libsdl2-dev && \
export PICO_SDK_PATH=$HOME/pico-sdk && \
mkdir build-linux && cd build-linux && \
cmake -G Ninja -DPICO_PLATFORM=host .. && \
cmake --build .
- name: Create release
uses: softprops/action-gh-release@v1
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ if (PICO_PLATFORM STREQUAL "host")
link_directories(
${SDL2_LIB_DIR}
)

# Enable compiler and linker garbage collect unused code/data sections
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
add_link_options(-Wl,--gc-sections)

else ()
#add_compile_definitions(${PROJECT_NAME} NO_GRAPHICS)
set(FAMILY rp2040)
Expand Down

0 comments on commit 7b1fda7

Please sign in to comment.