-
Notifications
You must be signed in to change notification settings - Fork 32
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
Are CMake files supposed to bring in dependencies? #27
Comments
This depends on whether your The easiest way to fix that, regardless of the above, is to forego the use of variables and use the imported targets instead. That is, remove the line
and replace
with
|
I did what you say, but the result is the same (cannot the
I believe that what |
If you configure with |
|
Interesting. When I install locally on Windows, I do have Thread depending on Chrono. But on Linux it doesn't, according to both your log and Travis: https://travis-ci.org/boostorg/boost_install/jobs/629443426 The difference is that Travis succeeds, but that's probably because I don't use condition_variable in my test: https://github.com/boostorg/boost_install/blob/develop/test/thread/quick.cpp I'll look into this. |
Thanks. There is clearly some logic behind whether depending on |
The logic is fairly straightforward; on Pthread platforms (https://github.com/boostorg/thread/blob/develop/build/Jamfile.v2#L256) Chrono is not added as a dependency and On Windows, Chrono is added as a dependency (https://github.com/boostorg/thread/blob/develop/build/Jamfile.v2#L282) and Then in the Pthread implementation of condition_variable all Chrono uses are guarded by What I don't understand is why your code compiles; you pass a Chrono duration to |
At https://github.com/boostorg/thread/blob/develop/include/boost/thread/detail/config.hpp#L143 |
Correct. I missed that in my search. Getting that define into the CMake config won't be easy though. |
I have no idea of what is the best way forward here. In line of principle saying that |
In fact, even if we did have code to properly move the defines from The immediate workaround from user point of view would be to just link to Chrono explicitly when using overloads taking |
Maybe the best way to solve this is to just have Thread always depend on Chrono after all. |
@giomasce whilst this is being resolved, in the cmake example i think we can explicitely request chrono component for the thread autopkgtest in Debian. |
Consider this
CMakeLists.txt
file:with this
test.cpp
file:When I try to compile with
cmake .
andmake
, the compilation fails withClearly
boost::condition_variable::wait_from
requiresboost::chrono::steady_clock::now
, but the latter is not automatically brought in as a dependency by CMake scripts. Should I expect CMake to automatically resolve dependencies towards other Boost libraries (i.e., this is a bug), or am I supposed to explicitly specifychrono
in theCMakeLists.txt
file?Thanks.
The text was updated successfully, but these errors were encountered: