Skip to content

Commit

Permalink
Add clang-18 build
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Sep 24, 2024
1 parent a44562c commit 7d38700
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- { os: "ubuntu-22.04", platform: "64", clang-version: "14", cxx-standard: "17", build-type: "Debug" }
- { os: "ubuntu-22.04", platform: "32", clang-version: "14", cxx-standard: "17", build-type: "Release" }
- { os: "ubuntu-22.04", platform: "32", clang-version: "14", cxx-standard: "17", build-type: "Debug" }

- { os: "ubuntu-24.04", platform: "64", clang-version: "18", cxx-standard: "17", build-type: "Debug" }

runs-on: ${{matrix.os}}
name: "\
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
# update when https://github.com/actions/upload-artifact/issues/543 is fixed
uses: actions/upload-artifact@v3
# we need to collect this artifact from a build which has both clang coverage and clang-tidy reports
if: ${{ matrix.platform == '64' && matrix.clang-version == '14' && matrix.cxx-standard == '17' &&
if: ${{ matrix.platform == '64' && matrix.clang-version != '' && matrix.cxx-standard == '17' &&
matrix.build-type == 'Debug' }}
with:
name: "zserio-runtime-cpp"
Expand Down
5 changes: 5 additions & 0 deletions cmake/compiler_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ function(compiler_get_warnings_setup VARNAME)
"-Wno-documentation-html"
"-Wno-documentation"
)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "18.0.0")
set(WARNINGS_SETUP_LIST "${WARNINGS_SETUP_LIST}"
"-Wno-unsafe-buffer-usage"
)
endif ()
string(REPLACE ";" " " WARNINGS_SETUP "${WARNINGS_SETUP_LIST}")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(WARNINGS_SETUP "/W3 /wd4800")
Expand Down
4 changes: 2 additions & 2 deletions cmake/coverage_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(create_coverage_target)
list(APPEND cov_exclude "--exclude=${cov_EXCLUDE_SOURCES}")
endif ()

set(cov_html_gcc_dir "${cov_html_dir}/gcc")
set(cov_html_gcc_dir "${cov_html_dir}/gcc$ENV{GCC_VERSION_SUFFIX}")
add_custom_target(
${cov_tgt_name}
COMMAND ${CMAKE_COMMAND} -E make_directory ${cov_html_gcc_dir}
Expand All @@ -65,7 +65,7 @@ function(create_coverage_target)
endif ()
set(cov_test_executable "${ZserioCpp17RuntimeTest_BINARY_DIR}/ZserioCpp17RuntimeTest")
set(cov_binary_dir "${PROJECT_BINARY_DIR}/${cov_tgt_name}")
set(cov_html_clang_dir "${cov_html_dir}/clang")
set(cov_html_clang_dir "${cov_html_dir}/clang$ENV{CLANG_VERSION_SUFFIX}")
add_custom_target(
${cov_tgt_name}
COMMAND ${CMAKE_COMMAND} -E make_directory ${cov_binary_dir}
Expand Down
3 changes: 1 addition & 2 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,5 @@ add_custom_target(ZserioCppRuntime-doxygen ALL
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zserio_doc DESTINATION .)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/coverage/clang DESTINATION zserio_doc/coverage OPTIONAL)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/coverage/gcc DESTINATION zserio_doc/coverage OPTIONAL)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/coverage/ DESTINATION zserio_doc/coverage OPTIONAL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/clang-tidy-report.txt DESTINATION zserio_doc/clang-tidy OPTIONAL)

0 comments on commit 7d38700

Please sign in to comment.