Skip to content

Commit 32b9949

Browse files
committed
暂存测试
1 parent b6ee814 commit 32b9949

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,28 @@ jobs:
2828
sudo apt-get install -y gcc-11 g++-11
2929
echo "CC=gcc-11" >> $GITHUB_ENV
3030
echo "CXX=g++-11" >> $GITHUB_ENV
31-
- name: Build-Release
31+
- name: Build-macosx
32+
if:
33+
run: |
34+
mkdir build
35+
cd build
36+
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
37+
cmake --build . --config Release
38+
ctest -V -C Release
39+
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
40+
41+
42+
- name: Build-Release
43+
3244
run: |
3345
mkdir build
3446
cd build
3547
cmake .. -DCMAKE_USER_MAKE_RULES_OVERRIDE="${{ github.workspace }}/cmake/flags_override.cmake"
3648
cmake --build . --config Release
3749
ctest -V -C Release
3850
cmake --install . --config Release --prefix ${{ github.workspace }}/artifact/
39-
- name: Upload
51+
52+
- name: Upload
4053
uses: actions/upload-artifact@v2
4154
with:
4255
name: ${{ matrix.platform }}

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ option(BuildCodeFormat "Build CodeFormat" ON)
99
option(BuildCodeFormatServer "Build CodeFormatServer" ON)
1010
option(EnableTest "Test project" ON)
1111

12+
1213
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1314
add_definitions(-DMSVC)
14-
else()
15-
set(CMAKE_C_FLAGS_RELEASE "-O2")
16-
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
15+
elseif(APPLE)
16+
include(CheckCCompilerFlag)
17+
18+
set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;x86_64")
19+
check_c_compiler_flag("-arch x86_64" x86_64Supported)
20+
message("x86_64Supported=${x86_64Supported}")
21+
22+
set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;arm64")
23+
check_c_compiler_flag("-arch arm64" arm64Supported)
24+
message("arm64Supported=${arm64Supported}")
1725
endif ()
1826

1927
add_subdirectory(LuaParser)

0 commit comments

Comments
 (0)