-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Dont use boost when its disabled USE_BOOST=Off #7655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
How does this happen? What is the error? |
This is the error:
This happens when building testastutils.cpp when it includes astutils.h. Making the include This cmake is such a mess and overcomplicated. It should use the Either way, even if we fix this, we should still be able to disable boost even if its installed on the system which is what this will allow. |
There should be not shared libraries at all. It only exists on Windows (it is not supposed to be working on other platforms) and I reckon it might have been an oversight in the Visual Studio project when that was introduced. I only added it to CMake so it will produce the same output as the included Visual Studio project (which should also not exist). I enabled Boost unconditionally because it improves performance measurably. I am still puzzled how CMake adds the Boost defines if it didn't find the library. |
The default would be static, but for development, shared library is convenient as building everything will be faster. If the cmake was setup properly this would be trivial to support. Removing these object libraries would make the cmake way simpler.
Then set
The perf probably doesnt help much when using the Debug build with UBSAN.
CMake finds boost and adds the include path to cppcheck-core, but since we include boost in the header files and we cant propagate usage requirements(because we are using object libraries) then anything that uses cppcheck-core will break. I dont really have time to refactor all the cmake, so for now being able to disable it and run the tests is good short-term solution. |
It is weird I have not experienced any issues with it. And I have countless different configurations and compilers locally... It is currently completely broken when using Visual Studio because CMake removed the old module but only when it is in
There is not much to refactor. As mentioned before the shared library should have never been added to CMake.
|
I understand what is going on now and it has nothing to do with shared/static/object libraries.
The |
If its setup properly then shared libraries dont need to be added, it should be supported out of the box. Shared libraries are useful to have for development.
It is related. Setting the include path to public on the cppcheck-core doesnt fix the issue, since the testrunner doesnt link cppcheck-core because its an object library. If we built this as a normal library(not object library) then the testrunner would link cppcheck-core and the public include paths would be added.
But you could set it to
Sure, in the meantime you can merge this since it will fix the issue, and you can work out the changes on windows. |
It "fixes" the issue but the change is wrong.
Yes - you can put everything upside down just because a single option was missing. It was a simple oversight which was made a few years ago and was exposed because we actually enabled the code. As usual in this code base ... |
I posted #7660 which also adds CI jobs which detect the issue. |
I filed https://trac.cppcheck.net/ticket/14003 about being able to disable boost again. |
More like putting it right side up. #7658 fixes any future issues we might have. If another component that uses the core(like the gui or cli) happens to include a file that includes boost, it will still work correctly. Plus it will make it easier to add dependencies or new executables. |
We are not using boost correctly as it fails when its not installed in the system path. We should be able to disable it when setting it to
Off
.