# Copyright 2017 Rene Rivera
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)

import feature ;

#| tag::doc[]

[[bbv2.builtin.features.dll-path]]`dll-path` (_Unix_ only)::
*Allowed values:* A directory path to shared libraries.
+
Specifies an additional directory where the system should look for shared
libraries when the target is run.
+
WARNING: Note that a relative path will be prepended with the directory of the relevant
`jam` file - as supplied on the `b2` command line - thus _severely_ limiting its
practical use!.
+
Please see the link:#bbv2.faq.dll-path[FAQ entry on the
`dll-path` and `hardcode-dll-paths`] for details, and the
link:#bbv2.builtin.features.hardcode-dll-paths[`hardcode-dll-paths`] feature
to automatically add paths for development.

|# # end::doc[]

feature.feature dll-path
    :
    : free path ;

#| tag::hardcode-doc[]

[[bbv2.builtin.features.hardcode-dll-paths]]`hardcode-dll-paths` (_Unix_ only)::
*Allowed values:* `true`, `false`. +
*Defaults to:* `true`(link:#bbv2.reference.rules.exe[`exe`]),
               `false`(link:#bbv2.reference.rules.install[`install`]) +
*Ignored for:* link:#bbv2.reference.rules.lib[`lib`]

+
When an ``exe``cutable is built with `<hardcode-dll-paths>true` (default),
the target binary will be linked with an _rpath list_ that contains all the
paths to the directories of used shared libraries.
+
When a target is ``install``ed with `<hardcode-dll-paths>true`, those same
paths, and any added with link:bbv2.builtin.features.dll-path[`<dll-path>`],
are propagated through to the resulting binary.
+
The purpose of this feature is to aid development; the resulting executable
(`exe` - but not `install` target) can by default be run, without
changing system paths to shared libraries or installing the libraries to
system paths. +
Please see the <<bbv2.faq.dll-path,FAQ entry>> for details.

|# # end::hardcode-doc[]

feature.feature hardcode-dll-paths
    : true false
    : incidental ;

# An internal feature that holds the paths of all dependency shared libraries.
# On Windows, it is needed so that we can add all those paths to PATH when
# running applications. On Linux, it is needed to add proper -rpath-link command
# line options.
feature.feature xdll-path
    :
    : free path ;

#| tag::def-doc[]

[[bbv2.builtin.features.def-file]]`def-file`::
Provides a means to specify def-file for windows DLLs.

|# # end::def-doc[]

feature.feature def-file
    :
    : free dependency ;

#| tag::suppress-doc[]

[[bbv2.builtin.features.suppress-import-lib]]`suppress-import-lib`::
Suppresses creation of import library by the linker.

|# # end::suppress-doc[]

feature.feature suppress-import-lib
    : false true
    : incidental ;
