mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
527a08ac42
This commit adds support for clang-tidy checks during compilation on macOS, which can now be enabled using the optional `WITH_CLANG_TIDY` CMake variable. The clang-tidy executable doesn't need to be separately installed since CMake will pick up the executable from the LLVM pre-compiled library. This commit also expands the coverage of clang-tidy checks to Objective-C/C++, for which checks were enabled in PR #128334. Pull Request: https://projects.blender.org/blender/blender/pulls/129761
19 lines
659 B
CMake
19 lines
659 B
CMake
# SPDX-FileCopyrightText: 2006 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
if(WITH_LEGACY_OPENGL)
|
|
add_definitions(-DWITH_LEGACY_OPENGL)
|
|
endif()
|
|
|
|
if(WITH_CLANG_TIDY AND NOT MSVC)
|
|
find_package(ClangTidy REQUIRED)
|
|
set(CLANG_TIDY_EXTRA_ARGS --extra-arg=-Wno-error=unknown-warning-option)
|
|
|
|
set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE};${CLANG_TIDY_EXTRA_ARGS})
|
|
set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE};${CLANG_TIDY_EXTRA_ARGS})
|
|
set(CMAKE_OBJC_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE};${CLANG_TIDY_EXTRA_ARGS})
|
|
set(CMAKE_OBJCXX_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE};${CLANG_TIDY_EXTRA_ARGS})
|
|
endif()
|
|
|
|
add_subdirectory(blender)
|