Skip to content

Commit

Permalink
Build libraries in MinSizeRel mode to reduce binary size
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickKa committed Dec 11, 2024
1 parent f301d4d commit 5dc4f54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ cd rodos
# We will need it later, so just copy it to the top-level directory
find . -name linux-x86.cmake | xargs cp -t ../ -v
if [[ $1 == "linux" ]]; then
cmake --toolchain cmake/port/linux-x86.cmake -S . -B build/linux-x86
cmake --toolchain cmake/port/linux-x86.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -S . -B build/linux-x86
cmake --build build/linux-x86
sudo cmake --install build/linux-x86
else
cmake --toolchain cmake/port/cobc.cmake -S . -B build/cobc
cmake --toolchain cmake/port/cobc.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -S . -B build/cobc
cmake --build build/cobc
sudo cmake --install build/cobc --prefix "$2"
fi
Expand All @@ -66,11 +66,11 @@ fi

cd littlefs
if [[ $1 == "linux" ]]; then
cmake --toolchain ../linux-x86.cmake -DLFS_THREADSAFE=ON -DLFS_NO_MALLOC=OFF -S . -B build/linux-x86
cmake --toolchain ../linux-x86.cmake -DLFS_THREADSAFE=ON -DLFS_NO_MALLOC=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -S . -B build/linux-x86
cmake --build build/linux-x86
sudo cmake --install build/linux-x86
else
cmake --toolchain ../stm32f411.cmake -DLFS_THREADSAFE=ON -DLFS_NO_MALLOC=OFF -S . -B build/cobc
cmake --toolchain ../stm32f411.cmake -DLFS_THREADSAFE=ON -DLFS_NO_MALLOC=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -S . -B build/cobc
cmake --build ./build/cobc
sudo cmake --install build/cobc --prefix "$2"
fi
Expand Down

0 comments on commit 5dc4f54

Please sign in to comment.