boostorg / thread

Boost.org thread module
http://boost.org/libs/thread
201 stars 161 forks source link

Fix search path for relative includes #365

Closed Flamefire closed 1 year ago

Flamefire commented 2 years ago

On recent Cygwins and other systems the source files path may not be added to the include search path leading to:

libs\thread\src\pthread\once.cpp:8:10: fatal error: ./once_atomic.cpp: No such file or directory 8 | #include "./once_atomic.cpp"

Add the path explicitly and add CI jobs for this (order/layout based on Boost.CI)

Required also for downstream libraries, see e.g. https://github.com/boostorg/atomic/pull/57

Flamefire commented 2 years ago

@pdimov Seemingly this is not as trivial as thought as the tests heavily rely on relative includes. Sometimes in the form of #include "../../../remove_error_code_unused_warning.hpp" which can't be easily fixed with an <include>..

So my proposal: Copy all headers used by tests (in the test folder or one of its subfolders) to test/include and add that folder to the include search path. Then adapt the include directives to #include "remove_error_code_unused_warning.hpp"

Any other idea?

BTW: No idea why the MSVC tests start to fail. Probably a time-related flake.

Flamefire commented 1 year ago

Turned out this was a B2 bug with slashes confusing the compiler -> Close