Note: Issue includes a short bit on why I did something with clang-tidy, as i think it might be related.
I am using GCC/Qt/CMake in my project, want to integrate static analysis into my build process. I tried to use clang-tidy individually but I got an error because apparently precompiled header formats are different.
I used the following CMake piece to generate a fake precompiled header for clang-tidy and it worked fine:
Now I want to use codechecker instead, I used the same CMake build process to generate compilation database and my precompiled header files.
However I am getting the following error:
error: PCH file was compiled for the target 'x86_64-pc-linux-gnu' but the current translation unit is being compiled for target 'x86_64-unknown-linux-gnu' [clang-diagnostic-error]
CodeChecker version
[INFO 2023-01-26 15:10] - CodeChecker analyzer version:
---------------------------------------
Kind | Version
---------------------------------------
Base package version | 6.21.0-rc
Package build date | 2022-11-11T15:38
Git commit ID (hash) |
Git tag information |
---------------------------------------
[WARNING 2023-01-26 15:10] - This version is only a release candidate! If you encounter any problems, please submit a bug report!
[INFO 2023-01-26 15:10] - CodeChecker web version:
------------------------------------------------------
Kind | Version
------------------------------------------------------
Base package version | 6.21.0-rc
Package build date | 2022-11-11T15:38
Git commit ID (hash) |
Git tag information |
Server supported Thrift API version | 6.51
Client Thrift API version | 6.51
------------------------------------------------------
[WARNING 2023-01-26 15:10] - This version is only a release candidate! If you encounter any problems, please submit a bug report!
To Reproduce
1)Create a CMake project using target_precompile_headers using GCC as compiler
2)Generate compilation database
3)Invoke codechecker analyze compile_commands.json -o ./reports in build directory
Expected behaviour
Expected it to work as clang-tidy did when called seperately.
Desktop (please complete the following information)
Note: Issue includes a short bit on why I did something with clang-tidy, as i think it might be related.
I am using GCC/Qt/CMake in my project, want to integrate static analysis into my build process. I tried to use clang-tidy individually but I got an error because apparently precompiled header formats are different.
I used the following CMake piece to generate a fake precompiled header for clang-tidy and it worked fine:
Now I want to use codechecker instead, I used the same CMake build process to generate compilation database and my precompiled header files.
However I am getting the following error:
error: PCH file was compiled for the target 'x86_64-pc-linux-gnu' but the current translation unit is being compiled for target 'x86_64-unknown-linux-gnu' [clang-diagnostic-error]
CodeChecker version
To Reproduce 1)Create a CMake project using
target_precompile_headers
using GCC as compiler 2)Generate compilation database 3)Invokecodechecker analyze compile_commands.json -o ./reports
in build directoryExpected behaviour Expected it to work as clang-tidy did when called seperately.
Desktop (please complete the following information)