bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
76 stars 228 forks source link

Support for Darwin `@xxx` placeholders in `dll-path` #335

Closed JBouwer closed 9 months ago

JBouwer commented 1 year ago

Support for Darwin @xxx placeholders in dll-path.

The Darwin platform supports special @xxx/ placeholders for linking into the run path list of binaries.

See the discussion #332 for background and details, as well as my rationale for choosing the following resolution.

The accompanying pull request resolves the issue as follows:

1) A new at-placeholder-translate-path-rule rule in src/tools/darwin.jam.

The rule conforms to the [`translate-path`](https://www.bfgroup.xyz/b2/manual/release/index.html#bbv2.builtin.features.translate-path) signature, and is exported to the global namespace with a qualifying "`darwin.`" prefix.

2) Modify property.translate in src/build/property.jam to allow for multiple translate-path-rules; The first rule to return a successful translation breaks the loop.

3) Add the darwin.at-placeholder-translate-path-rule from (1) to the list of translate-path-rules - whenever src/tools/darwin.jam is loaded.

I could not come up with a better way to do this - any alternative suggestions will be welcomed.

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

JBouwer commented 1 year ago

Documentation for the above in 205b5971e61861cebbf1764d2f295f04b12f08b1, on top of generic documentation update PR #334.

grafikrobot commented 9 months ago

Decided to go a much simpler way to resolve this. See https://github.com/bfgroup/b2/commit/d1c231218604c9c8c9e0c10c33d79de3b448426e

JBouwer commented 9 months ago

Excellent! :ok_hand: Thanks for considering!