Skip to content

Commit

Permalink
添加 Windows 集成
Browse files Browse the repository at this point in the history
  • Loading branch information
SageMik committed Oct 17, 2024
0 parents commit ebaf8df
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/simple.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 编译 Simple 原生库

on:
push:
branches: [ "simple-native" ]
pull_request:
branches: [ "simple-native" ]
workflow_dispatch:

jobs:
Windows-CMake-DLL:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

# Flutter 不支持 32位 Windows,所以只编译 x64 即可,不需要 x86
- name: '设置构建类型和构建目录'
id: preset
run: |
echo "BUILD_TYPE=Release" >> $env:GITHUB_OUTPUT
echo "BUILD_ARCH=X64" >> $env:GITHUB_OUTPUT
echo "BUILD_DIR=${{ github.workspace }}/windows_build" >> $env:GITHUB_OUTPUT
- name: 'CMake 编译,通过 VS16 生成器'
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: "${{ github.workspace }}/CMakeLists.txt"
buildDirectory: ${{ steps.preset.outputs.BUILD_DIR }}
useVcpkgToolchainFile: true
cmakeBuildType: ${{ steps.preset.outputs.BUILD_TYPE }}
buildWithCMake: true
cmakeGenerator: VS16Win64
cmakeAppendedArgs: -A ${{ steps.preset.outputs.BUILD_ARCH }}
buildWithCMakeArgs: --config ${{ steps.preset.outputs.BUILD_TYPE }}

- name: '上传编译产物'
uses: actions/upload-artifact@v4
with:
name: windows
path: "${{ steps.preset.outputs.BUILD_DIR }}/_deps/simple-build/src/${{ steps.preset.outputs.BUILD_TYPE }}/simple.dll"
retention-days: 90
compression-level: 0
overwrite: true
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.19)

project(simple_without_sqlite3)

include(FetchContent)

FetchContent_Declare(simple
GIT_REPOSITORY https://github.com/wangfenjin/simple.git
GIT_TAG 473fc89
)
set(BUILD_SQLITE3 OFF)
set(BUILD_TEST_EXAMPLE OFF)
FetchContent_MakeAvailable(simple)
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# simple-native

该分支用于编译和维护不含 SQLite 的 Simple 原生库,以供主分支使用。

通过 Github Actions 进行持续集成(CI),详见 [`.github/workflow/simple.yaml`](.github/workflows/simple.yml)

| 平台 | 持续集成 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Android** | 否,通过 Gradle & CMake 编译:[simple-android-native](https://github.com/SageMik/simple-android-native),<br />Android 项目可从 Maven Central 引入 |
| **iOS** | 待集成,手动编译产物在主分支 |
| **Windows** ||
| **MacOS** | 待集成 |
| **Linux** | 待定 |
| **Web** | 待定 |

0 comments on commit ebaf8df

Please sign in to comment.