Skip to content

include from same dir#79

Merged
ptsouchlos merged 1 commit intoptsouchlos:mainfrom
dg0yt:includes
Aug 14, 2025
Merged

include from same dir#79
ptsouchlos merged 1 commit intoptsouchlos:mainfrom
dg0yt:includes

Conversation

@dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Aug 9, 2025

thread_safe_queue.h is in the same directory as thread_pool.h.

The original path prefix made #include "..." perform worse, because the first attempt (same dir) would always fail, and it requires user to have the parent dir of thread_pool in the header search path.

@ptsouchlos
Copy link
Owner

Just curious: How are you including thread-pool in your project?

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 11, 2025

Just curious: How are you including thread-pool in your project?

The original issue was reported for thread-pool installed in Visual Studio via vcpkg, using

#include <thread-pool-0.7.0/thread_pool/thread_pool.h>

I still think it shouldn't be used with this statement. But I noticed that a simple change could resolve that issue and improve regular use (installed CMake, sub-project, whatever).

@UMU618
Copy link

UMU618 commented Aug 13, 2025

Just curious: How are you including thread-pool in your project?

Better #include <thread_pool/thread_pool.h>, but vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

@UMU618
Copy link

UMU618 commented Aug 13, 2025

image

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 13, 2025

vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

The installation of the header is made by this pristine command;
https://github.com/DeveloperPaul123/thread-pool/blob/03f4b67386045fc8443479b918f3a728450f7adf/CMakeLists.txt#L130-L135

But this is not the topic of this PR.

@ptsouchlos
Copy link
Owner

Just curious: How are you including thread-pool in your project?

Better #include <thread_pool/thread_pool.h>, but vcpkg install dp-thread-pool to a versioned path(%VCPKG_ROOT%\installed\x64-windows\include\thread-pool-0.7.0\thread_pool), which I think it's wrong.

Yes my original idea was to allow for multiple versions to be installed side-by-side but I realize now that it's not idiomatic to do that 😅 Certainly something that can be fixed in the future.

@ptsouchlos
Copy link
Owner

Once I have time to pull this locally and test it should be good to merge

@ptsouchlos ptsouchlos merged commit a0aa5bc into ptsouchlos:main Aug 14, 2025
13 checks passed
@dg0yt dg0yt deleted the includes branch August 14, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants