C++: Silence alerts coming from CMake test compilation files

This commit is contained in:
Jeroen Ketema
2025-01-05 17:28:23 +01:00
parent ede801ed88
commit 06f6bac169
9 changed files with 53 additions and 9 deletions

View File

@@ -0,0 +1,28 @@
/**
* Provides classes for identifying files that created to test the
* build configuration. It is often desirable to exclude these files
* from analysis.
*/
import File
/**
* A file created to test the system configuration.
*/
abstract class ConfigurationTestFile extends File { }
/**
* A file created by CMake to test the system configuration.
*/
class CmakeTryCompileFile extends ConfigurationTestFile {
CmakeTryCompileFile() {
exists(Folder folder, Folder parent |
folder = this.getParentContainer() and
parent = folder.getParentContainer()
|
folder.getBaseName().matches("TryCompile-%") and
parent.getBaseName() = "CMakeScratch" and
parent.getParentContainer().getBaseName() = "CMakeFiles"
)
}
}