Skip to content

Commit 9940736

Browse files
committed
test actions clang windows
1 parent 591cd08 commit 9940736

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ jobs:
5757
name: frontend
5858
path: ${{github.workspace}}/frontend
5959

60+
- name: Install ninja on windows
61+
run: choco install ninja
62+
if: ${{ matrix.os }} == "windows-latest"
63+
6064
- name: Build and test
6165
run: ./make.ps1 -prebuiltFrontend frontend/flipbook.js
6266
shell: pwsh

Core/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ endif()
5454

5555
find_package(OpenMP)
5656
if(OpenMP_CXX_FOUND)
57-
target_link_libraries(SimpleImageIOCore PUBLIC OpenMP::OpenMP_CXX)
57+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
58+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
59+
target_link_libraries(SimpleImageIOCore PUBLIC ${OpenMP_CXX_LIBRARIES})
60+
target_compile_options(SimpleImageIOCore PUBLIC ${OpenMP_CXX_FLAGS})
61+
target_link_options(SimpleImageIOCore PUBLIC ${OpenMP_EXE_LINKER_FLAGS})
5862
else()
5963
message("WARNING: Could not find OpenMP! Performance will be lower.")
6064
endif()

make.ps1

+19
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,25 @@ if (-not $skipRuntimes)
8080
cmake --build . --config Release
8181
if (-not $?) { throw "Build failed" }
8282
}
83+
elseif ([environment]::OSVersion::IsWindows())
84+
{
85+
if (Get-Command "ninja" -ErrorAction SilentlyContinue && Get-Command "clang" -ErrorAction SilentlyContinue)
86+
{
87+
cmake -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Release ..
88+
if (-not $?) { throw "CMake configure failed" }
89+
90+
cmake --build . --config Release
91+
if (-not $?) { throw "Build failed" }
92+
}
93+
else
94+
{
95+
cmake -DCMAKE_BUILD_TYPE=Release ..
96+
if (-not $?) { throw "CMake configure failed" }
97+
98+
cmake --build . --config Release
99+
if (-not $?) { throw "Build failed" }
100+
}
101+
}
83102
else
84103
{
85104
cmake -DCMAKE_BUILD_TYPE=Release ..

0 commit comments

Comments
 (0)