Skip to content

Commit

Permalink
[CPU] Enable clang-format for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDuplensky committed Dec 14, 2024
1 parent 702ce05 commit 0ba0059
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ jobs:
level: warning
fail_on_error: true

clang-format:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
permissions:
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'true'

- name: Install clang-format-15
run: |
sudo apt update
sudo apt --assume-yes install clang-format-15
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
- name: CMake configure
run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/clang-aarch64.toolchain.cmake -B build_aarch64

- name: Create code style diff
run: cmake --build build_aarch64 --target clang_format_fix_all -j8

- name: suggester / clang-format
if: startsWith(github.event_name, 'pull_request')
uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3 # v1.18.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning
fail_on_error: true

ShellCheck:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'openvinotoolkit' }}
Expand Down
14 changes: 14 additions & 0 deletions cmake/clang-aarch64.toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

set(CMAKE_C_COMPILER clang-15)
set(CMAKE_CXX_COMPILER clang++-15)
set(CMAKE_LINKER lld)

set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu)
#set(CMAKE_SYSROOT /usr/aarch64-linux-gnu)
# set(PKG_CONFIG_EXECUTABLE aarch64-linux-gnu-pkg-config CACHE PATH "Path to ARM64 pkg-config")

0 comments on commit 0ba0059

Please sign in to comment.