diff --git a/CMakeLists.txt b/CMakeLists.txt index ee10e65d452be..24d62f1df2b4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,8 @@ option(LOCALIZE "Support for language localizations. Also enable UTF support option(LANGUAGES "Compile localization files for specified languages." "" ) option(DYNAMIC_LINKING "Use dynamic linking. Or use static to remove MinGW dependency instead." "ON") option(CATA_CLANG_TIDY_PLUGIN "Build Cata's custom clang-tidy plugin" "OFF") -set(LLVM_INCLUDE_DIRS "" CACHE STRING "Paths to llvm and clang headers used for clang-tidy plugin") +set(CATA_CLANG_TIDY_INCLUDE_DIR "" CACHE STRING "Path to internal clang-tidy headers required for plugin (e.g. ClangTidy.h)") +set(CATA_CHECK_CLANG_TIDY "" CACHE STRING "Path to check_clang_tidy.py for plugin tests") set(GIT_BINARY "" CACHE STRING "Git binary name or path.") set(PREFIX "" CACHE STRING "Location of Data & GFX directories") diff --git a/tools/clang-tidy-plugin/test/lit.cfg b/tools/clang-tidy-plugin/test/lit.cfg index 8bb0b760a4531..bf660481acf60 100644 --- a/tools/clang-tidy-plugin/test/lit.cfg +++ b/tools/clang-tidy-plugin/test/lit.cfg @@ -10,8 +10,9 @@ config.test_exec_root = os.path.join( config.suffixes = ['.cpp'] -check_clang_tidy = os.getenv('CHECK_CLANG_TIDY') -if not check_clang_tidy: +if config.cata_check_clang_tidy: + check_clang_tidy = config.cata_check_clang_tidy +else: check_clang_tidy = os.path.join( config.plugin_build_root, 'clang-tidy-plugin-support', 'bin', 'check_clang_tidy.py') diff --git a/tools/clang-tidy-plugin/test/lit.site.cfg.in b/tools/clang-tidy-plugin/test/lit.site.cfg.in index eb6646f79c027..aae4d01870d78 100644 --- a/tools/clang-tidy-plugin/test/lit.site.cfg.in +++ b/tools/clang-tidy-plugin/test/lit.site.cfg.in @@ -1,6 +1,7 @@ import os config.plugin_build_root = "@CMAKE_CURRENT_BINARY_DIR@" +config.cata_check_clang_tidy = "@CATA_CHECK_CLANG_TIDY@" lit_config.load_config( config, os.path.join("@CMAKE_CURRENT_SOURCE_DIR@", "test", "lit.cfg"))