Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
Checks: '-*,clang-analyzer-core*,clang-analyzer-cplusplus*,cppcoreguidelines-*,bugprone-*,readability-*,performance-*,modernize-*,misc-*,-bugprone-suspicious-include,-readability-identifier-length,-modernize-use-trailing-return-type,-readability-braces-around-statements'
WarningsAsErrors: ''
HeaderFileExtensions:
- ''
- h
- hh
- hpp
- hxx
ImplementationFileExtensions:
- c
- cc
- cpp
- cxx
HeaderFilterRegex: '.*'
SystemHeaders: false
...

23 changes: 22 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

cmake_minimum_required(VERSION 3.16.3)

option(BUILD_CLANG_TIDY "Enable usage of clang-tidy" OFF)
if(BUILD_CLANG_TIDY)
find_program(CLANG_TIDY "clang-tidy" REQUIRED)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-extra-arg=-Wno-unknown-warning-option")
endif()

macro(qsk_setup_options)

option(BUILD_PEDANTIC "Enable pedantic compile flags ( only GNU/CLANG )" OFF)
Expand Down Expand Up @@ -81,7 +87,7 @@ endmacro()
############################################################################

project(QSkinny
LANGUAGES C CXX
LANGUAGES C CXX
HOMEPAGE_URL "https://github.com/uwerat/qskinny"
VERSION 0.8.0)

Expand Down Expand Up @@ -170,3 +176,18 @@ endif()
if(BUILD_PLAYGROUND)
add_subdirectory(playground)
endif()

if(BUILD_CLANG_TIDY)
file(GLOB_RECURSE EXAMPLE_FILES
${CMAKE_CURRENT_LIST_DIR}/examples/*.h
${CMAKE_CURRENT_LIST_DIR}/examples/*.hpp
${CMAKE_CURRENT_LIST_DIR}/examples/*.c
${CMAKE_CURRENT_LIST_DIR}/examples/*.cpp
${CMAKE_CURRENT_LIST_DIR}/playground/*.h
${CMAKE_CURRENT_LIST_DIR}/playground/*.hpp
${CMAKE_CURRENT_LIST_DIR}/playground/*.c
${CMAKE_CURRENT_LIST_DIR}/playground/*.cpp
)

set_source_files_properties(${EXAMPLE_FILES} PROPERTIES SKIP_LINTING ON)
endif()

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not required since clang-tidy disabled on test target already

8 changes: 5 additions & 3 deletions cmake/QskBuildFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ function(qsk_add_executable target)
qt6_add_executable(${ARGV})

# we manually export our APIs to QML - might change in the future
set_target_properties(${target} PROPERTIES
set_target_properties(${target} PROPERTIES
QT_QML_MODULE_NO_IMPORT_SCAN 1)
else()
add_executable(${ARGV})
endif()

set_target_properties(${target} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
CXX_CLANG_TIDY ""
)

endfunction()

Expand Down Expand Up @@ -105,7 +107,7 @@ function(qsk_add_example target)
target_link_libraries(${target} PRIVATE qskqmlexport)
endif()

# for examples with subdirectories
# for examples with subdirectories
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_LIST_DIR})

endfunction()
Expand Down