mirror of
https://github.com/siyuan-note/siyuan
synced 2026-04-21 13:37:52 +00:00
🔨 Update kernel building script
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
39f861e986
commit
f2e6587120
9 changed files with 19 additions and 19 deletions
8
.github/CONTRIBUTING.md
vendored
8
.github/CONTRIBUTING.md
vendored
|
|
@ -41,8 +41,8 @@ Note: In the development environment, the kernel process will not be automatical
|
|||
### Desktop
|
||||
|
||||
* `cd kernel`
|
||||
* Windows: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
|
||||
* Linux/macOS: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel"`
|
||||
* Windows: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
|
||||
* Linux/macOS: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel"`
|
||||
* `cd ../app/kernel`
|
||||
* Windows: `./SiYuan-Kernel.exe --wd=.. --mode=dev`
|
||||
* Linux/macOS: `./SiYuan-Kernel --wd=.. --mode=dev`
|
||||
|
|
@ -50,14 +50,14 @@ Note: In the development environment, the kernel process will not be automatical
|
|||
### iOS
|
||||
|
||||
* `cd kernel`
|
||||
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
|
||||
* `gomobile bind -tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
|
||||
* https://github.com/siyuan-note/siyuan-ios
|
||||
|
||||
### Android
|
||||
|
||||
* `cd kernel`
|
||||
* `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8`
|
||||
* `gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
||||
* `gomobile bind -tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
||||
* https://github.com/siyuan-note/siyuan-android
|
||||
|
||||
### Harmony
|
||||
|
|
|
|||
8
.github/CONTRIBUTING_zh_CN.md
vendored
8
.github/CONTRIBUTING_zh_CN.md
vendored
|
|
@ -41,8 +41,8 @@ NPM 镜像:
|
|||
### 桌面端
|
||||
|
||||
* `cd kernel`
|
||||
* Windows: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
|
||||
* Linux/macOS: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel"`
|
||||
* Windows: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"`
|
||||
* Linux/macOS: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel"`
|
||||
* `cd ../app/kernel`
|
||||
* Windows: `./SiYuan-Kernel.exe --wd=.. --mode=dev`
|
||||
* Linux/macOS: `./SiYuan-Kernel --wd=.. --mode=dev`
|
||||
|
|
@ -50,14 +50,14 @@ NPM 镜像:
|
|||
### iOS
|
||||
|
||||
* `cd kernel`
|
||||
* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
|
||||
* `gomobile bind -tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/`
|
||||
* https://github.com/siyuan-note/siyuan-ios
|
||||
|
||||
### Android
|
||||
|
||||
* `cd kernel`
|
||||
* `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8`
|
||||
* `gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
||||
* `gomobile bind -tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/`
|
||||
* https://github.com/siyuan-note/siyuan-android
|
||||
|
||||
### Harmony
|
||||
|
|
|
|||
2
.github/workflows/cd.yml
vendored
2
.github/workflows/cd.yml
vendored
|
|
@ -213,7 +213,7 @@ jobs:
|
|||
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel
|
||||
|
||||
- name: Building Kernel
|
||||
run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ github.repository }}/kernel/util.${{ matrix.config.build_args_suffix }}"
|
||||
run: go build -tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ github.repository }}/kernel/util.${{ matrix.config.build_args_suffix }}"
|
||||
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel
|
||||
env:
|
||||
GO111MODULE: on
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
|
|||
|
||||
ADD kernel/ .
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg \
|
||||
go build --tags fts5 -v -ldflags "-s -w"
|
||||
go build -tags fts5 -v -ldflags "-s -w"
|
||||
|
||||
FROM alpine:latest
|
||||
LABEL maintainer="Liang Ding<845765@qq.com>"
|
||||
|
|
|
|||
|
|
@ -24,4 +24,4 @@ export GOARCH=amd64
|
|||
export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=x86_64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot"
|
||||
export CGO_LDFLAGS="--target=x86_64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/x86_64"
|
||||
|
||||
go build --tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so .
|
||||
go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so .
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@ export GOARCH=arm64
|
|||
export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=aarch64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot"
|
||||
export CGO_LDFLAGS="--target=aarch64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/arm64-v8a"
|
||||
|
||||
go build --tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so .
|
||||
#go build --tags fts5 -buildmode=c-shared -v -o libkernel.so .
|
||||
go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so .
|
||||
#go build -tags fts5 -buildmode=c-shared -v -o libkernel.so .
|
||||
|
|
|
|||
|
|
@ -70,13 +70,13 @@ if [[ "$TARGET" == 'amd64' || "$TARGET" == 'all' ]]; then
|
|||
echo
|
||||
echo 'Building Kernel amd64'
|
||||
export GOARCH=amd64
|
||||
go build --tags fts5 -v -o "../app/kernel-darwin/SiYuan-Kernel" -ldflags "-s -w" .
|
||||
go build -tags fts5 -v -o "../app/kernel-darwin/SiYuan-Kernel" -ldflags "-s -w" .
|
||||
fi
|
||||
if [[ "$TARGET" == 'arm64' || "$TARGET" == 'all' ]]; then
|
||||
echo
|
||||
echo 'Building Kernel arm64'
|
||||
export GOARCH=arm64
|
||||
go build --tags fts5 -v -o "../app/kernel-darwin-arm64/SiYuan-Kernel" -ldflags "-s -w" .
|
||||
go build -tags fts5 -v -o "../app/kernel-darwin-arm64/SiYuan-Kernel" -ldflags "-s -w" .
|
||||
fi
|
||||
|
||||
echo
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ if [[ "$TARGET" == 'amd64' || "$TARGET" == 'all' ]]; then
|
|||
echo 'Building Kernel amd64'
|
||||
export GOARCH=amd64
|
||||
export CC=~/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc
|
||||
go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
||||
go build -buildmode=pie -tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
||||
fi
|
||||
if [[ "$TARGET" == 'arm64' || "$TARGET" == 'all' ]]; then
|
||||
echo
|
||||
echo 'Building Kernel arm64'
|
||||
export GOARCH=arm64
|
||||
export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc
|
||||
go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
||||
go build -buildmode=pie -tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" .
|
||||
fi
|
||||
|
||||
echo
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ if defined BUILD_AMD64 (
|
|||
echo.
|
||||
echo Building Kernel amd64
|
||||
set GOARCH=amd64
|
||||
go build --tags fts5 -v -o "%PROJECT_ROOT%\app\kernel\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" .
|
||||
go build -tags fts5 -v -o "%PROJECT_ROOT%\app\kernel\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" .
|
||||
if errorlevel 1 (
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
|
@ -112,7 +112,7 @@ if defined BUILD_ARM64 (
|
|||
set GOARCH=arm64
|
||||
@REM if you want to build arm64, you need to install aarch64-w64-mingw32-gcc
|
||||
set CC="D:/Program Files/llvm-mingw-20240518-ucrt-x86_64/bin/aarch64-w64-mingw32-gcc.exe"
|
||||
go build --tags fts5 -v -o "%PROJECT_ROOT%\app\kernel-arm64\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" .
|
||||
go build -tags fts5 -v -o "%PROJECT_ROOT%\app\kernel-arm64\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" .
|
||||
if errorlevel 1 (
|
||||
exit /b %errorlevel%
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue