File tree 4 files changed +36
-3
lines changed
.github/actions/build-native-binary
4 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 68
68
-DSUA_MEASURE_CODE_COVERAGE=NO \
69
69
..
70
70
make -j
71
- make install
71
+ make install/strip
72
+ shell : bash
73
+
74
+ - name : Strip binaries for amd64
75
+ if : ${{ inputs.arch == 'amd64' }}
76
+ run : |
77
+ strip dist_${{ inputs.arch }}/lib/lib*
78
+ shell : bash
79
+
80
+ - name : Strip binaries for arm64
81
+ if : ${{ inputs.arch == 'arm64' }}
82
+ run : |
83
+ aarch64-linux-gnu-strip dist_${{ inputs.arch }}/lib/lib*
72
84
shell : bash
73
85
74
86
- name : Build for amd64 with code-coverage enabled
Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ RUN cd /work \
51
51
52
52
RUN cd /work \
53
53
&& cd build_amd64 \
54
- && make install
54
+ && make install/strip
55
+
56
+ RUN cd /work \
57
+ && strip dist_amd64/lib/lib* \
58
+ && strip /work/build_amd64/glib/gio/libgio-2.0.so.0 \
59
+ && strip /work/build_amd64/glib/gobject/libgobject-2.0.so.0 \
60
+ && strip /work/build_amd64/glib/glib/libglib-2.0.so.0 \
61
+ && strip /work/build_amd64/glib/gmodule/libgmodule-2.0.so.0 \
62
+ && strip /work/build_amd64/glib/subprojects/libffi/src/libffi.so.7 \
63
+ && strip /work/build_amd64/glib/subprojects/zlib-1.2.11/libz.so
55
64
56
65
#Define RUNTIME environment, the final image
57
66
FROM --platform=${TARGETPLATFORM} scratch as runtime
Original file line number Diff line number Diff line change @@ -51,7 +51,16 @@ RUN cd /work \
51
51
52
52
RUN cd /work \
53
53
&& cd build_arm64 \
54
- && make install
54
+ && make install/strip
55
+
56
+ RUN cd /work \
57
+ && aarch64-linux-gnu-strip dist_arm64/lib/lib* \
58
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/gio/libgio-2.0.so.0 \
59
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/gobject/libgobject-2.0.so.0 \
60
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/glib/libglib-2.0.so.0 \
61
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/gmodule/libgmodule-2.0.so.0 \
62
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/subprojects/libffi/src/libffi.so.7 \
63
+ && aarch64-linux-gnu-strip /work/build_arm64/glib/subprojects/zlib-1.2.11/libz.so
55
64
56
65
#Define RUNTIME environment, the final image
57
66
FROM --platform=${TARGETPLATFORM} scratch as runtime
Original file line number Diff line number Diff line change @@ -41,7 +41,10 @@ list(FILTER SRCS EXCLUDE REGEX "main.cpp" )
41
41
list (APPEND SRCS ${CMAKE_CURRENT_BINARY_DIR} /version .cpp)
42
42
43
43
add_library (sua SHARED ${SRCS} )
44
+ set_target_properties (sua PROPERTIES LINK_FLAGS -s)
45
+
44
46
add_executable (${PROJECT_NAME} ${SRCS} main.cpp)
47
+ set_target_properties (${PROJECT_NAME} PROPERTIES LINK_FLAGS -s)
45
48
46
49
link_directories (${CMAKE_BINARY_DIR} /3rdparty/curl/lib)
47
50
You can’t perform that action at this time.
0 commit comments