Skip to content

Commit 229c057

Browse files
committed
2 parents 0a00664 + 0df76da commit 229c057

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

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

Lines changed: 19 additions & 5 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')
@@ -66,5 +80,5 @@ jobs:
6680
- uses: actions/upload-artifact@v4
6781
if: startsWith(matrix.os, 'windows')
6882
with:
69-
name: Serial Programs for windows (${{ matrix.qt_version }})
83+
name: Serial Programs ( os=${{ matrix.os }} - qt_version=${{ matrix.qt_version }} - compiler=${{ matrix.compiler }})
7084
path: Output

ClientSource/Connection/SerialConnectionWinAPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SerialConnection : public StreamConnection{
4444
throw ConnectionException(nullptr, "Unable to open serial connection (" + name + "). Error = " + std::to_string(error));
4545
}
4646

47-
DCB serial_params{0};
47+
DCB serial_params{};
4848
serial_params.DCBlength = sizeof(serial_params);
4949

5050
if (!GetCommState(m_handle, &serial_params)){
@@ -67,7 +67,7 @@ class SerialConnection : public StreamConnection{
6767
}
6868

6969
#if 1
70-
COMMTIMEOUTS timeouts{0};
70+
COMMTIMEOUTS timeouts{};
7171
if (!GetCommTimeouts(m_handle, &timeouts)){
7272
DWORD error = GetLastError();
7373
CloseHandle(m_handle);

SerialPrograms/CMakeLists.txt

Lines changed: 12 additions & 3 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
@@ -2505,6 +2505,15 @@ if (MSVC)
25052505
set(ARCH_FLAGS_17_Skylake /arch:AVX512)
25062506
set(ARCH_FLAGS_19_IceLake /arch:AVX512)
25072507

2508+
if(CMAKE_GENERATOR_TOOLSET MATCHES "ClangCL")
2509+
target_compile_options(SerialPrograms PRIVATE -Wno-unused-function)
2510+
target_compile_options(SerialPrograms PRIVATE -march=nehalem)
2511+
set(ARCH_FLAGS_09_Nehalem -march=nehalem)
2512+
set(ARCH_FLAGS_13_Haswell -march=haswell)
2513+
set(ARCH_FLAGS_17_Skylake -march=skylake-avx512)
2514+
set(ARCH_FLAGS_19_IceLake -march=icelake-client)
2515+
endif()
2516+
25082517
# Run-time ISA dispatching
25092518
target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_08_Nehalem)
25102519
target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_13_Haswell)
@@ -2619,7 +2628,7 @@ else() # macOS and Linux
26192628

26202629
else()
26212630
# Intel CPU
2622-
target_compile_options(SerialPrograms PRIVATE -msse4.2)
2631+
target_compile_options(SerialPrograms PRIVATE -march=nehalem)
26232632
set(ARCH_FLAGS_09_Nehalem -march=nehalem)
26242633
set(ARCH_FLAGS_13_Haswell -march=haswell)
26252634
set(ARCH_FLAGS_17_Skylake -march=skylake-avx512)

SerialPrograms/Source/PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern const std::chrono::milliseconds INFERENCE_RATE;
2727
class HostingSwitch : public IntegerEnumDropdownOption{
2828
public:
2929
HostingSwitch();
30+
using ConfigOption::check_validity;
3031
std::string check_validity(size_t consoles) const;
3132
};
3233

0 commit comments

Comments
 (0)