Git Product home page Git Product logo

Comments (5)

jpakkane avatar jpakkane commented on May 28, 2024

The whole threading issue with compilers and systems is complicated (as one would expect). I really want to have a good solution for the general case but unfortunately don't have all the knowledge, especially on the Windows side of things.

In the mean time I'll do a fix for this particular case soon, because it really should work automatically.

from meson.

RobinMcCorkell avatar RobinMcCorkell commented on May 28, 2024

Perhaps it doesn't make sense to use the dependency() construct to define a testing framework? It might be better to have an additional parameter to the test() construct, a framework parameter? Then that parameter would bring in the required dependencies, which may be more than one (like here: Boost testing framework requires unit_test_framework, system and pthreads).

IMHO it makes sense for dependency() to require explicit declaration of all libraries required - it shouldn't do automatic dependency evaluation.

from meson.

axxel avatar axxel commented on May 28, 2024

I agree with Jussi: this should work automatically. Especially since the dependency on pthreads is an implementation detail (and platform specific). If there were proper (upstream) pkg-config support for boost, it would also list -lpthreads in its --libs list (at least, I would expect it to. see also https://svn.boost.org/trac/boost/ticket/1094)

If someone wonders why an explicit -pthread is necessary when using the boost::mutex but not when using boost::thread, even though the implementation of the latter is also clearly dependent on libpthread. Here is some background: https://wiki.debian.org/ToolChain/DSOLinking.

Also: this issue has nothing to do with 'testing'. I simply modified the existing test to have a quick and easy example to reproduce the issue. Having said that, there might be other boost libs than boost_thread that have #include-based dependencies on external libs.

from meson.

axxel avatar axxel commented on May 28, 2024

The boost test case now works for me, but my own project does not configure anymore. I get the following python exception:

Traceback (most recent call last):
  File "/home/axel/bin/meson.py", line 184, in <module>
    app.generate()
  File "/home/axel/bin/meson.py", line 147, in generate
    g.generate()
  File "/home/axel/contrib/meson.git/ninjabackend.py", line 132, in generate
    [self.generate_target(t, outfile) for t in self.build.get_targets().values()]
  File "/home/axel/contrib/meson.git/ninjabackend.py", line 132, in <listcomp>
    [self.generate_target(t, outfile) for t in self.build.get_targets().values()]
  File "/home/axel/contrib/meson.git/ninjabackend.py", line 263, in generate_target
    elem = self.generate_link(target, outfile, outname, sorted(obj_list), linker, pch_objects)
  File "/home/axel/contrib/meson.git/ninjabackend.py", line 1293, in generate_link
    commands += linker.thread_link_flags()
AttributeError: 'ArLinker' object has no attribute 'thread_link_flags'

from meson.

jpakkane avatar jpakkane commented on May 28, 2024

I pushed a fix.

from meson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.