Skip to content

Commit 403a294

Browse files
committed
Add clang on the CI for windows and linux
1 parent d0f8707 commit 403a294

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,26 @@ 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:
1516
- qt_version: '6.9.1'
1617
qt_version_major: '6'
1718
qt_modules: 'qtmultimedia qtserialport'
1819

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
32+
1933
steps:
2034
- uses: actions/checkout@v4
2135
with:
@@ -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: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,7 +2414,7 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../Internal/SerialPrograms/Internal0.
24142414
endif()
24152415

24162416
#extract opencv_world4110d.dll from archive on Windows Debug builds
2417-
if (MSVC)
2417+
if (WIN32)
24182418
file(ARCHIVE_EXTRACT
24192419
INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4110d.zip
24202420
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/
@@ -2429,7 +2429,7 @@ target_link_directories(SerialPrograms PRIVATE ../3rdPartyBinaries/)
24292429

24302430

24312431

2432-
if (MSVC)
2432+
if (WIN32)
24332433
add_library(OpenCV_lib IMPORTED UNKNOWN)
24342434
target_include_directories(SerialPrograms SYSTEM PRIVATE ../3rdParty/opencv-4.11.0/)
24352435
set_target_properties(OpenCV_lib PROPERTIES
@@ -2492,14 +2492,15 @@ if (MSVC)
24922492
PA_DPP
24932493
)
24942494

2495-
target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /external:anglebrackets /external:W0 /utf-8)
2496-
target_compile_options(SerialPrograms PRIVATE /wd5054) # Deprecated enum arithemtic
2497-
target_compile_options(SerialPrograms PRIVATE /wd4505) # unreferenced local function has been removed
2495+
if (MSVC)
2496+
target_compile_options(SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /external:anglebrackets /external:W0 /utf-8)
2497+
target_compile_options(SerialPrograms PRIVATE /wd5054) # Deprecated enum arithemtic
2498+
target_compile_options(SerialPrograms PRIVATE /wd4505) # unreferenced local function has been removed
24982499

2499-
set(ARCH_FLAGS_09_Nehalem /W4) # Dummy parameter
2500-
set(ARCH_FLAGS_13_Haswell /arch:AVX2)
2501-
set(ARCH_FLAGS_17_Skylake /arch:AVX512)
2502-
set(ARCH_FLAGS_19_IceLake /arch:AVX512)
2500+
set(ARCH_FLAGS_09_Nehalem /W4) # Dummy parameter
2501+
set(ARCH_FLAGS_13_Haswell /arch:AVX2)
2502+
set(ARCH_FLAGS_17_Skylake /arch:AVX512)
2503+
set(ARCH_FLAGS_19_IceLake /arch:AVX512)
25032504

25042505
# Run-time ISA dispatching
25052506
target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_08_Nehalem)

vcpkg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 9a023fa7d4c8c9ed3fa5b1be466e605b10b9d220

0 commit comments

Comments
 (0)