Skip to content

Commit c08d227

Browse files
committed
Add clang on the CI for windows and linux
1 parent 5763090 commit c08d227

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

.github/workflows/cpp-ci-serial-programs.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,25 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [windows-2025, macos-13, ubuntu-24.04]
13+
compiler: ['default', 'clang']
1314
qt_version: ['6.9.1']
1415
include:
15-
- qt_version: '6.9.1'
16-
qt_version_major: '6'
17-
qt_modules: 'qtmultimedia qtserialport'
16+
- qt_version: '6.9.1'
17+
qt_version_major: '6'
18+
qt_modules: 'qtmultimedia qtserialport'
19+
20+
- os: 'windows-2025'
21+
compiler: 'clang'
22+
cmake_additional_param: '-T ClangCL'
23+
24+
- os: 'ubuntu-24.04'
25+
compiler: 'clang'
26+
cmake_additional_param: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
27+
28+
exclude:
29+
- os: 'macos-13'
30+
compiler: 'clang'
31+
# Excluded because macos default toolset is already clang
1832

1933
steps:
2034
- uses: actions/checkout@v4
@@ -44,7 +58,7 @@ jobs:
4458
cd Arduino-Source/SerialPrograms
4559
mkdir bin
4660
cd bin
47-
cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }}
61+
cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }} ${{ matrix.cmake_additional_param }}
4862
cmake --build . --config Release --parallel 10
4963
- name: Copy resources
5064
if: startsWith(matrix.os, 'windows')

SerialPrograms/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,7 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../Internal/SerialPrograms/Internal0.
24182418
endif()
24192419

24202420
#extract opencv_world4110d.dll from archive on Windows Debug builds
2421-
if (MSVC)
2421+
if (WIN32)
24222422
file(ARCHIVE_EXTRACT
24232423
INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4110d.zip
24242424
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/
@@ -2433,7 +2433,7 @@ target_link_directories(SerialPrograms PRIVATE ../3rdPartyBinaries/)
24332433

24342434

24352435

2436-
if (MSVC)
2436+
if (WIN32)
24372437
add_library(OpenCV_lib IMPORTED UNKNOWN)
24382438
target_include_directories(SerialPrograms SYSTEM PRIVATE ../3rdParty/opencv-4.11.0/)
24392439
set_target_properties(OpenCV_lib PROPERTIES
@@ -2496,14 +2496,16 @@ if (MSVC)
24962496
PA_DPP
24972497
)
24982498

2499-
target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /external:anglebrackets /external:W0 /utf-8)
2500-
target_compile_options(SerialPrograms PRIVATE /wd5054) # Deprecated enum arithemtic
2501-
target_compile_options(SerialPrograms PRIVATE /wd4505) # unreferenced local function has been removed
2499+
if (MSVC)
2500+
target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /external:anglebrackets /external:W0 /utf-8)
2501+
target_compile_options(SerialPrograms PRIVATE /wd5054) # Deprecated enum arithemtic
2502+
target_compile_options(SerialPrograms PRIVATE /wd4505) # unreferenced local function has been removed
25022503

2503-
set(ARCH_FLAGS_09_Nehalem /W4) # Dummy parameter
2504-
set(ARCH_FLAGS_13_Haswell /arch:AVX2)
2505-
set(ARCH_FLAGS_17_Skylake /arch:AVX512)
2506-
set(ARCH_FLAGS_19_IceLake /arch:AVX512)
2504+
set(ARCH_FLAGS_09_Nehalem /W4) # Dummy parameter
2505+
set(ARCH_FLAGS_13_Haswell /arch:AVX2)
2506+
set(ARCH_FLAGS_17_Skylake /arch:AVX512)
2507+
set(ARCH_FLAGS_19_IceLake /arch:AVX512)
2508+
endif()
25072509

25082510
# Run-time ISA dispatching
25092511
target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_08_Nehalem)

0 commit comments

Comments
 (0)