Skip to content

Commit ff78b85

Browse files
committed
Add executable stripping step in build workflow; update toolchain for size optimization
1 parent 452e508 commit ff78b85

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
cmake -B build -DCMAKE_TOOLCHAIN_FILE=toolchain-mingw.cmake -DCMAKE_BUILD_TYPE=Release
3131
- name: Build
3232
run: cmake --build build
33+
- name: Strip executable
34+
run: x86_64-w64-mingw32-strip build/ghostinjector-*.exe
3335
- name: Rename executable
3436
run: mv build/ghostinjector-*.exe build/ghostinjector.exe
3537

toolchain-mingw.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
set(CMAKE_SYSTEM_NAME Windows)
33
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
44
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
5-
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
5+
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
6+
7+
# Optimize for size in release builds
8+
string(APPEND CMAKE_C_FLAGS_RELEASE " -Os")

0 commit comments

Comments
 (0)