@@ -8,13 +8,14 @@ cmake_policy(SET CMP0077 NEW)
88project (inja LANGUAGES CXX VERSION 3.4.0)
99
1010
11- option (INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON )
12- option (INJA_INSTALL "Generate install targets for inja" ON )
13- option (INJA_INSTALL_SINGLE_HEADER "Install the single header instead" OFF )
14- option (INJA_EXPORT "Export the current build tree to the package registry" ON )
1511option (BUILD_TESTING "Build unit tests" ON )
16- option (INJA_BUILD_TESTS "Build unit tests when BUILD_TESTING is enabled." ON )
1712option (COVERALLS "Generate coveralls data" OFF )
13+ option (INJA_BUILD_TESTS "Build unit tests when BUILD_TESTING is enabled." ON )
14+ option (INJA_ENABLE_CLANG_TIDY "Enable clang-tidy" OFF )
15+ option (INJA_EXPORT "Export the current build tree to the package registry" ON )
16+ option (INJA_INSTALL "Generate install targets for inja" ON )
17+ option (INJA_INSTALL_SINGLE_HEADER "Install the single header instead" OFF )
18+ option (INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON )
1819
1920
2021set (INJA_INSTALL_INCLUDE_DIR "include" )
@@ -94,6 +95,12 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)
9495 target_compile_options (inja_test PRIVATE -Wall -Wextra -Werror)
9596 endif ()
9697
98+ if (INJA_ENABLE_CLANG_TIDY)
99+ find_program (CLANG_TIDY_EXE NAMES "clang-tidy" REQUIRED)
100+ set (CLANG_TIDY_COMMAND "${CLANG_TIDY_EXE} " "-config-file=${CMAKE_CURRENT_SOURCE_DIR} /.clang-tidy" )
101+ set_target_properties (inja_test PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND} " )
102+ endif ()
103+
97104
98105 add_library (single_inja INTERFACE )
99106 target_compile_features (single_inja INTERFACE cxx_std_17)
@@ -106,8 +113,7 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)
106113 add_test (single_inja_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /single_inja_test)
107114
108115
109- add_executable (inja_benchmark test /benchmark.cpp
110- test /test -common.hpp)
116+ add_executable (inja_benchmark test /benchmark.cpp test /test -common.hpp)
111117 target_link_libraries (inja_benchmark PRIVATE inja)
112118 target_include_directories (inja_benchmark PRIVATE third_party/include )
113119endif ()
0 commit comments