diff --git a/.github/workflows/cpp-ci-serial-programs.yml b/.github/workflows/cpp-ci-serial-programs.yml index fa84978aba..4e42f2ce51 100644 --- a/.github/workflows/cpp-ci-serial-programs.yml +++ b/.github/workflows/cpp-ci-serial-programs.yml @@ -10,11 +10,25 @@ jobs: fail-fast: false matrix: os: [windows-2025, macos-13, ubuntu-24.04] + compiler: ['default', 'clang'] qt_version: ['6.9.1'] include: - - qt_version: '6.9.1' - qt_version_major: '6' - qt_modules: 'qtmultimedia qtserialport' + - qt_version: '6.9.1' + qt_version_major: '6' + qt_modules: 'qtmultimedia qtserialport' + + - os: 'windows-2025' + compiler: 'clang' + cmake_additional_param: '-T ClangCL' + + - os: 'ubuntu-24.04' + compiler: 'clang' + cmake_additional_param: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' + + exclude: + - os: 'macos-13' + compiler: 'clang' + # Excluded because macos default toolset is already clang steps: - uses: actions/checkout@v4 @@ -44,7 +58,7 @@ jobs: cd Arduino-Source/SerialPrograms mkdir bin cd bin - cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }} + cmake .. -DQT_MAJOR:STRING=${{ matrix.qt_version_major }} ${{ matrix.cmake_additional_param }} cmake --build . --config Release --parallel 10 - name: Copy resources if: startsWith(matrix.os, 'windows') @@ -66,5 +80,5 @@ jobs: - uses: actions/upload-artifact@v4 if: startsWith(matrix.os, 'windows') with: - name: Serial Programs for windows (${{ matrix.qt_version }}) + name: Serial Programs ( os=${{ matrix.os }} - qt_version=${{ matrix.qt_version }} - compiler=${{ matrix.compiler }}) path: Output diff --git a/ClientSource/Connection/SerialConnectionWinAPI.h b/ClientSource/Connection/SerialConnectionWinAPI.h index 1b3360184a..676d98344d 100644 --- a/ClientSource/Connection/SerialConnectionWinAPI.h +++ b/ClientSource/Connection/SerialConnectionWinAPI.h @@ -44,7 +44,7 @@ class SerialConnection : public StreamConnection{ throw ConnectionException(nullptr, "Unable to open serial connection (" + name + "). Error = " + std::to_string(error)); } - DCB serial_params{0}; + DCB serial_params{}; serial_params.DCBlength = sizeof(serial_params); if (!GetCommState(m_handle, &serial_params)){ @@ -67,7 +67,7 @@ class SerialConnection : public StreamConnection{ } #if 1 - COMMTIMEOUTS timeouts{0}; + COMMTIMEOUTS timeouts{}; if (!GetCommTimeouts(m_handle, &timeouts)){ DWORD error = GetLastError(); CloseHandle(m_handle); diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index 3b60e91c6f..e6a72327b4 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -2418,7 +2418,7 @@ if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../Internal/SerialPrograms/Internal0. endif() #extract opencv_world4110d.dll from archive on Windows Debug builds -if (MSVC) +if (WIN32) file(ARCHIVE_EXTRACT INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/opencv_world4110d.zip DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/ @@ -2433,7 +2433,7 @@ target_link_directories(SerialPrograms PRIVATE ../3rdPartyBinaries/) -if (MSVC) +if (WIN32) add_library(OpenCV_lib IMPORTED UNKNOWN) target_include_directories(SerialPrograms SYSTEM PRIVATE ../3rdParty/opencv-4.11.0/) set_target_properties(OpenCV_lib PROPERTIES @@ -2505,6 +2505,15 @@ if (MSVC) set(ARCH_FLAGS_17_Skylake /arch:AVX512) set(ARCH_FLAGS_19_IceLake /arch:AVX512) + if(CMAKE_GENERATOR_TOOLSET MATCHES "ClangCL") + target_compile_options(SerialPrograms PRIVATE -Wno-unused-function) + target_compile_options(SerialPrograms PRIVATE -march=nehalem) + set(ARCH_FLAGS_09_Nehalem -march=nehalem) + set(ARCH_FLAGS_13_Haswell -march=haswell) + set(ARCH_FLAGS_17_Skylake -march=skylake-avx512) + set(ARCH_FLAGS_19_IceLake -march=icelake-client) + endif() + # Run-time ISA dispatching target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_08_Nehalem) target_compile_definitions(SerialPrograms PRIVATE PA_AutoDispatch_x64_13_Haswell) @@ -2619,7 +2628,7 @@ else() # macOS and Linux else() # Intel CPU - target_compile_options(SerialPrograms PRIVATE -msse4.2) + target_compile_options(SerialPrograms PRIVATE -march=nehalem) set(ARCH_FLAGS_09_Nehalem -march=nehalem) set(ARCH_FLAGS_13_Haswell -march=haswell) set(ARCH_FLAGS_17_Skylake -march=skylake-avx512) diff --git a/SerialPrograms/Source/PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h b/SerialPrograms/Source/PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h index fcb190a986..6b4e8335cf 100644 --- a/SerialPrograms/Source/PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h +++ b/SerialPrograms/Source/PokemonSwSh/MaxLair/Options/PokemonSwSh_MaxLair_Options.h @@ -27,6 +27,7 @@ extern const std::chrono::milliseconds INFERENCE_RATE; class HostingSwitch : public IntegerEnumDropdownOption{ public: HostingSwitch(); + using ConfigOption::check_validity; std::string check_validity(size_t consoles) const; };