Skip to content

Commit 65d9977

Browse files
committed
fix: include easy to use cmake settings for toolchain setup
1 parent 9a2a91f commit 65d9977

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
make -C libs ARCH=${{ matrix.target }}
8181
rm -rf /opt/musl-dyne/share/man
8282
cat README.md | awk '{gsub(/\[[^][]+\]\([^()]+\)/, gensub(/\[([^][]+)\]\([^()]+\)/, "\\1", "g")); print}' | fmt -w 72 > /opt/musl-dyne/README.txt
83+
cp settings.cmake /opt/musl-dyne/
8384
echo "Compressing: musl-dyne-${{ matrix.output }}.tar.xz"
8485
cd /opt && tar -cJf musl-dyne-${{ matrix.output }}.tar.xz musl-dyne
8586
- name: Upload release artifacts musl-dyne-${{ matrix.output }}

settings.cmake

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# CMake settings for the dyne/musl toolchain
2+
3+
set(ARCH "x86_64-linux-musl" CACHE STRING "Target architecture to (cross)compile")
4+
set(PREFIX "/opt/musl-dyne")
5+
set(CMAKE_CXX_FLAGS "-static -g0 -Os -fstack-protector-all -D_FORTIFY_SOURCE=2 -fno-strict-overflow")
6+
# -I ${PREFIX}/${ARCH}/include
7+
include_directories(SYSTEM "${PREFIX}/${ARCH}/include")
8+
# set(CMAKE_PREFIX_PATH "${PREFIX}/${ARCH}")
9+
set(CMAKE_SYSROOT "${PREFIX}/${ARCH}")
10+
11+
# Remove flags added by build type
12+
set(CMAKE_BUILD_TYPE "Release")
13+
set(CMAKE_CXX_FLAGS_RELEASE "")
14+
set(CMAKE_C_COMPILER "${PREFIX}/bin/${ARCH}-gcc")
15+
set(CMAKE_CXX_COMPILER "${PREFIX}/bin/${ARCH}-g++")
16+
option(CCACHE "Use ccache to speed up compilation")
17+
if(CCACHE)
18+
set(CMAKE_CXX_COMPILER_LAUNCHER "ccache")
19+
endif()

0 commit comments

Comments
 (0)