Skip to content

Commit 2346f74

Browse files
committed
add more CI
1 parent 5e1d917 commit 2346f74

11 files changed

Lines changed: 79 additions & 16 deletions

File tree

.github/workflows/linux.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@ jobs:
1212
strategy:
1313
matrix:
1414
config: [Release, Debug]
15+
standalone: [OFF, ON]
16+
toolchain: [linux-gnu, linux-clang]
1517
steps:
1618
- uses: actions/checkout@v4
1719
- name: Install dependencies
1820
run: sudo apt-get install cmake ninja-build libbz2-dev
1921
- name: Build
2022
run: |
21-
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }}
23+
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DPRISM_STANDALONE=${{ matrix.standalone }} -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/${{ matrix.toolchain }}.cmake
2224
cmake --build build-cmake -j
2325
- name: Create Package
26+
if: ${{ matrix.config == 'Release' && matrix.standalone == 'ON' && matrix.toolchain == 'linux-gnu' }}
2427
run: |
2528
mkdir prism-release
2629
cp build-cmake/prism prism-release/
2730
cp "$(ldconfig -p | grep libbz2.so.1.0 | tr ' ' '\n' | grep /| head -n1)" prism-release/
2831
- name: Publish packaged artifacts
29-
if: ${{ matrix.config == 'Release' }}
32+
if: ${{ matrix.config == 'Release' && matrix.standalone == 'ON' && matrix.toolchain == 'linux-gnu' }}
3033
uses: actions/upload-artifact@v4
3134
with:
3235
name: prism-linux-x64

.github/workflows/mac.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,33 @@ jobs:
1212
strategy:
1313
matrix:
1414
config: [Release, Debug]
15+
standalone: [OFF, ON]
16+
toolchain: [macos-clang, macos-gnu] # remove temporary macos-clang-llvm
1517
steps:
1618
- uses: actions/checkout@v4
1719
- name: Install dependencies
1820
run: brew install cmake ninja xcodes
21+
- name: Download llvm
22+
if: ${{ matrix.toolchain == 'macos-clang-llvm' }}
23+
run: |
24+
brew install llvm lld
25+
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
26+
- name: Download gnu
27+
if: ${{ matrix.toolchain == 'macos-gnu' }}
28+
run: |
29+
brew install gcc
30+
echo "/opt/homebrew/opt/gcc/bin" >> $GITHUB_PATH
1931
- name: Build
2032
run: |
21-
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }}
33+
cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DPRISM_STANDALONE=${{ matrix.standalone }} -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/${{ matrix.toolchain }}.cmake
2234
cmake --build build-cmake -j
2335
- name: Create Package
36+
if: ${{ matrix.config == 'Release' && matrix.standalone == 'ON' && matrix.toolchain == 'macos-clang' }}
2437
run: |
2538
mkdir prism-release
2639
cp build-cmake/prism prism-release/
2740
- name: Publish packaged artifacts
28-
if: ${{ matrix.config == 'Release' }}
41+
if: ${{ matrix.config == 'Release' && matrix.standalone == 'ON' && matrix.toolchain == 'macos-clang' }}
2942
uses: actions/upload-artifact@v4
3043
with:
3144
name: prism-mac-bin

.github/workflows/windows.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,40 @@ jobs:
1212
strategy:
1313
matrix:
1414
config: [Release, Debug]
15-
toolchain: [v143, clangcl]
15+
toolchain: [windows-msvc, windows-clang-cl]
16+
standalone: [OFF, ON]
17+
generate: [Visual Studio 17 2022, Ninja]
18+
arch: [x64, Win32]
19+
exclude:
20+
- toolchain: windows-clang-cl
21+
arch: Win32
1622
steps:
1723
- uses: actions/checkout@v4
18-
- name: Build
24+
- name: Build Visual Studio
25+
if: ${{ matrix.generate == 'Visual Studio 17 2022' }}
1926
run: |
20-
cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T ${{ matrix.toolchain }} -A x64 -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }}
21-
cmake --build ./build/x64
27+
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DPRISM_STANDALONE=${{ matrix.standalone }}
28+
cmake --build ./build/${{ matrix.arch }}
29+
- name: Setup Variables
30+
if: ${{ matrix.generate == 'Ninja' }}
31+
uses: ilammy/msvc-dev-cmd@v1
32+
with:
33+
arch: ${{ matrix.arch }}
34+
- name: Build Ninja
35+
if: ${{ matrix.generate == 'Ninja' }}
36+
run: |
37+
cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DPRISM_STANDALONE=${{ matrix.standalone }}
38+
cmake --build ./build/${{ matrix.arch }}
2239
- name: Publish packaged artifacts
23-
if: ${{ matrix.config == 'Release' }}
40+
if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }}
2441
uses: actions/upload-artifact@v4
2542
with:
26-
name: prism-windows-x64-${{ matrix.config }}
27-
path: build/x64/Release/prism.exe
43+
name: prism-windows-${{ matrix.arch }}-${{ matrix.config }}
44+
path: build/${{ matrix.arch }}/${{ matrix.config }}/prism.exe
2845
- name: Test
2946
continue-on-error: true
3047
run: |
31-
cd build/x64
48+
cd build/${{ matrix.arch }}
3249
ctest -j -C Debug
3350
- name: Echo Test Results
34-
run: cat build/x64/Testing/Temporary/LastTest.log
51+
run: cat build/${{ matrix.arch }}/Testing/Temporary/LastTest.log

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ else()
7373
/W3;
7474
/${LINK_TYPE}
7575
>
76-
# /bigobj
7776
/permissive-;
7877
/MP;
7978
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
@@ -89,11 +88,14 @@ else()
8988
/INCREMENTAL:NO;
9089
/FORCE:MULTIPLE
9190
>
92-
# /bigobj;
9391
/MANIFEST:NO;
9492
/DEBUG;
9593
/SUBSYSTEM:CONSOLE
9694
)
95+
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
96+
target_compile_options(${PROJECT_NAME} PRIVATE /bigobj)
97+
target_link_options(${PROJECT_NAME} PRIVATE /bigobj)
98+
endif()
9799

98100
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
99101
endif()
@@ -121,7 +123,14 @@ if(PRISM_STANDALONE)
121123
target_link_libraries(${PROJECT_NAME} PRIVATE spdlog)
122124
else()
123125
find_package(spdlog QUIET)
124-
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog)
126+
if (NOT spdlog_FOUND)
127+
FetchContent_Declare(
128+
spdlog
129+
GIT_REPOSITORY https://github.com/gabime/spdlog.git
130+
GIT_TAG 7e635fca68d014934b4af8a1cf874f63989352b7
131+
)
132+
endif()
133+
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog)
125134
endif()
126135

127136
if(NOT PRISM_STANDALONE)

cmake/toolchain/linux-clang.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(CMAKE_C_COMPILER /usr/bin/clang)
2+
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
3+
set(CMAKE_LINKER /usr/bin/ld)

cmake/toolchain/linux-gnu.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(CMAKE_C_COMPILER /usr/bin/gcc)
2+
set(CMAKE_CXX_COMPILER /usr/bin/g++)
3+
set(CMAKE_LINKER /usr/bin/ld)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(CMAKE_C_COMPILER /opt/homebrew/opt/llvm/bin/clang)
2+
set(CMAKE_CXX_COMPILER /opt/homebrew/opt/llvm/bin/clang++)
3+
set(CMAKE_LINKER /opt/homebrew/opt/lld/bin/lld-link)

cmake/toolchain/macos-clang.cmake

Whitespace-only changes.

cmake/toolchain/macos-gnu.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(CMAKE_C_COMPILER /usr/bin/gcc)
2+
set(CMAKE_CXX_COMPILER /usr/bin/g++)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if (CMAKE_GENERATOR MATCHES "Visual Studio")
2+
set(CMAKE_GENERATOR_TOOLSET "clangcl")
3+
else()
4+
set(CMAKE_C_COMPILER clang-cl.exe)
5+
set(CMAKE_CXX_COMPILER clang-cl.exe)
6+
set(CMAKE_LINKER lld-link.exe)
7+
endif()

0 commit comments

Comments
 (0)