diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index e918d2224c..6d3724e189 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -24,10 +24,10 @@ jobs: - name: Install codespell run: pip3 install codespell - - name: Lint - if: always() - working-directory: asio - run: cmake -D FORMAT_COMMAND=clang-format-18 -P cmake/lint.cmake || echo ignored + # - name: Lint + # if: always() + # working-directory: asio + # run: cmake -D FORMAT_COMMAND=clang-format-18 -P cmake/lint.cmake || echo ignored - name: Spell check if: always() @@ -58,11 +58,11 @@ jobs: - name: Build working-directory: asio - run: cmake --build build/coverage -j 2 + run: cmake --build build/coverage -j 4 - name: Test working-directory: asio/build/coverage - run: ctest --output-on-failure --no-tests=error -j 2 + run: ctest --output-on-failure --no-tests=error -j 4 - name: Process coverage info working-directory: asio @@ -89,7 +89,7 @@ jobs: - name: Build working-directory: asio - run: cmake --build build/sanitize -j 2 + run: cmake --build build/sanitize -j 4 - name: Test working-directory: asio/build/sanitize @@ -100,12 +100,13 @@ jobs: strict_init_order=1:\ detect_leaks=1" UBSAN_OPTIONS: print_stacktrace=1 - run: ctest --output-on-failure --no-tests=error -j 2 + run: ctest --output-on-failure --no-tests=error -j 4 test: needs: [lint] strategy: + fail-fast: false matrix: os: [macos-15, ubuntu-24.04, windows-2022] @@ -116,27 +117,50 @@ jobs: - name: Install static analyzers if: matrix.os == 'ubuntu-24.04' - run: >- - sudo apt-get install clang-tidy-18 cppcheck -y -q - - sudo update-alternatives --install - /usr/bin/clang-tidy clang-tidy - /usr/bin/clang-tidy-18 150 + run: | + sudo apt-get install cppcheck ninja-build -y -q + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 19 all + sudo update-alternatives --install \ + /usr/bin/clang-tidy clang-tidy \ + /usr/bin/clang-tidy-19 150 + + - name: Install llvm-19 + if: startsWith(matrix.os, 'macos') + run: | + brew install llvm@19 + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.envrc + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"' >> /Users/runner/.envrc + echo 'export CPPFLAGS="-L/opt/homebrew/opt/llvm/include"' >> /Users/runner/.envrc - - name: Setup MultiToolTask + - name: Configure windows if: matrix.os == 'windows-2022' + working-directory: asio run: | Add-Content "$env:GITHUB_ENV" 'UseMultiToolTask=true' Add-Content "$env:GITHUB_ENV" 'EnforceProcessCountAcrossBuilds=true' + cmake --preset=ci-windows - - name: Configure - shell: pwsh + - name: Configure macos + if: matrix.os == 'macos-15' + working-directory: asio + shell: bash + run: | + source /Users/runner/.envrc + which clang++ && clang++ --version + CXX=$(brew --prefix llvm@19)/bin/clang++ cmake --preset=ci-macos + + - name: Configure ubuntu + if: matrix.os == 'ubuntu-24.04' working-directory: asio - run: cmake "--preset=ci-$("${{ matrix.os }}".split("-")[0])" + env: + CXX: clang++-19 + run: cmake --preset=ci-ubuntu - name: Build working-directory: asio - run: cmake --build build --config Release -j 2 + run: cmake --build build --config Release -j 4 - name: Install working-directory: asio @@ -144,7 +168,7 @@ jobs: - name: Test working-directory: asio/build - run: ctest --output-on-failure --no-tests=error -C Release -j 2 + run: ctest --output-on-failure --no-tests=error -C Release -j 4 docs: # Deploy docs only when builds succeed diff --git a/asio/CMakePresets.json b/asio/CMakePresets.json index 54d79bd15b..92970d30bc 100644 --- a/asio/CMakePresets.json +++ b/asio/CMakePresets.json @@ -59,7 +59,7 @@ "hidden": true, "cacheVariables": { "CMAKE_CXX_FLAGS": - "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wno-conversion -Wno-sign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wno-old-style-cast", + "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wno-conversion -Wno-sign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wno-implicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wno-old-style-cast", "CMAKE_EXE_LINKER_FLAGS": "-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now", "CMAKE_SHARED_LINKER_FLAGS": diff --git a/asio/src/examples/CMakeLists.txt b/asio/src/examples/CMakeLists.txt index 5c87da82ed..8886b1368a 100644 --- a/asio/src/examples/CMakeLists.txt +++ b/asio/src/examples/CMakeLists.txt @@ -23,6 +23,8 @@ if(PROJECT_IS_TOP_LEVEL) add_link_options(-stdlib=libc++) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) set(USE_MODULES TRUE) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(USE_MODULES TRUE) endif() message(STATUS "CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES=${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}") endif() @@ -34,7 +36,7 @@ if(PROJECT_IS_TOP_LEVEL) endif() # set(ALL_EXAMPLES cpp20/operations/callback_wrapper.cpp) -# set(ALL_EXAMPLES module/tests/main.cpp) +# list(APPEND ALL_EXAMPLES ../../module/tests/main.cpp) set(ALL_EXAMPLES main) message(STATUS "Examples to be built: ${ALL_EXAMPLES}")