flashlight / text

Text utilities, including beam search decoding, tokenizing, and more, built for use in Flashlight.
MIT License
64 stars 14 forks source link

Always find Threads in downstream projects, even w/o standalone #58

Closed jacobkahn closed 1 year ago

jacobkahn commented 1 year ago

Summary

Even though the CMake Threads::Threads target is linked to flashlight-text via private link visibility (such that downstream targets can't see the required target dep, it still creates a LINK_ONLY genexp in the generated flashlight-text-targets config, which means that Threads is required.

This is always required in any build, standalone or not, so make the find_dependency call in flashlight-text-config agnostic to whether or not FL_TEXT_BUILD_STANDALONE is enabled.

This was discovered whe using a Linux arm64 machine runner (with more comprehensive CircleCI matrices) which wasn't configured to have libpthread along its LD_LIBRARY_PATH for whatever reason, and required explicit linkage. Either way, the Threads::Threads target is generated, and needs to be valid regardless of the setup.

Checklist

Test plan: CI on machine Linux arm64 runner, which revealed the problem + local test

facebook-github-bot commented 1 year ago

@jacobkahn has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@jacobkahn merged this pull request in flashlight/text@714cde9ad880db4b8fe8cf0cb6a4b9de9fece430.