Skip to content

Commit

Permalink
Don't use "liblib" in the output names with Unix toolsets
Browse files Browse the repository at this point in the history
If the target happens to already have "lib" prefix, don't append it
again as this looks ugly.
  • Loading branch information
vadz committed Jan 8, 2024
1 parent c18e96a commit ec88cf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Enhancements

- Automatically create output directory in "gnu" toolset if necessary.
- Allow using "arm64" architecture name (useful with "gnu-osx" toolset).
- Don't use "liblib" in the output libraries names with Unix toolsets.

v1.2.6 (2020-10-17)
===================
Expand Down
11 changes: 10 additions & 1 deletion src/bkl/plugins/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,16 @@ def _get_filename(self, toolset, target, propname, fileclass):
ext = "%s_extension" % fileclass
parts = []
if prefix in tdir:
parts.append(getattr(toolset, prefix))
# This is normally used to prepend "lib" prefix automatically, but
# we want to avoid doing this if the target name already starts
# with "lib" as having "liblib" in the name is clearly undesirable
# and working around this in application bakefiles is not simple
# as it requires using platform-specific checks (assuming we do
# want to have just the "lib" prefix under non-Unix platforms), so
# do it here.
prefix_value = getattr(toolset, prefix)
if prefix_value and not target[propname].as_py().startswith(prefix_value):
parts.append(prefix_value)
parts.append(target[propname])
if not target.is_variable_null("extension"):
parts.append(target["extension"])
Expand Down

0 comments on commit ec88cf7

Please sign in to comment.