From 0f168b3a8d9bf7c2a180bab2195cc0d5075236b5 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Mon, 12 Aug 2024 18:19:02 +0800 Subject: [PATCH] update for github actions --- .github/workflows/ubuntu.yml | 2 +- .github/workflows/ubuntu_aarch64.yml | 5 +++-- .github/workflows/windows.yml | 9 +++++++-- xmake.lua | 3 +-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e707fcf..e11f5ce 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -35,7 +35,7 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: 2.9.2 + xmake-version: 2.9.4 actions-cache-folder: '.xmake-cache' actions-cache-key: 'ubuntu' diff --git a/.github/workflows/ubuntu_aarch64.yml b/.github/workflows/ubuntu_aarch64.yml index 6d56ef0..8568344 100644 --- a/.github/workflows/ubuntu_aarch64.yml +++ b/.github/workflows/ubuntu_aarch64.yml @@ -16,6 +16,7 @@ jobs: matrix: os: [ubuntu-latest] cross: [aarch64-linux-musl] + kind: [static, shared] concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cross-Musl-${{ matrix.cross }} @@ -41,7 +42,7 @@ jobs: - uses: xmake-io/github-action-setup-xmake@v1 with: - xmake-version: 2.9.2 + xmake-version: 2.9.4 actions-cache-folder: '.xmake-cache' - name: Installation musl @@ -51,7 +52,7 @@ jobs: - name: configure run: | - xmake f -p cross -a aarch64 --sdk=`pwd`/${{ matrix.cross }}-cross -k shared -y -vD --mo=y --http_client_zip=y --http_client_ssl=y + xmake f -p cross -a aarch64 --sdk=`pwd`/${{ matrix.cross }}-cross -k ${{ matrix.kind }} -y -vD --mo=y --http_client_zip=y --http_client_ssl=y - name: build run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 001e5cb..df8db85 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,8 @@ jobs: strategy: matrix: os: [windows-2019, windows-2022] - arch: [x64] #, arm64] + arch: [x64, arm64] + kind: [static, shared] concurrency: group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Windows-${{ matrix.os }}-${{ matrix.arch }} @@ -32,10 +33,14 @@ jobs: - name: configure shell: cmd run: | - xmake f -c -k shared -y -vD --mo=y --http_client_zip=y --http_client_ssl=y + xmake f -c -a ${{ matrix.arch }} -k ${{ matrix.kind }} -y -vD --mo=y --http_client_zip=y --http_client_ssl=y - name: build shell: cmd run: | xmake -b unit-test + - name: test + run: | + xmake r unit-test + diff --git a/xmake.lua b/xmake.lua index 294d023..cf15dce 100644 --- a/xmake.lua +++ b/xmake.lua @@ -101,6 +101,7 @@ if not is_plat("windows") then -- disable some compiler errors add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_cxflags("-ftemplate-depth=1023", "-pthread") + add_cxxflags("-frtti") ---- gcc 只能用于编译 C++ 文件,否则保报错 add_shflags("-pthread") add_ldflags("-pthread") end @@ -161,8 +162,6 @@ if has_config("http_client") or has_config("node") then end end - - target("hku_utils") set_kind("$(kind)")