RejectedSoftware Forums

Sign up

A couple of questions

Hello,

  1. Is there any way to modify build options for dependencies? E.g. version identifiers, library search paths, etc.
  2. preBuildCommands/preGenerateCommands in dependencies seem to execute in the working directory of the current project, and not in the directory of corresponding dependencies. Could this be fixed please? =)

Thanx.

Re: A couple of questions

On Thu, 24 Jul 2014 15:18:46 GMT, Yuriy wrote:

Hello,

  1. Is there any way to modify build options for dependencies? E.g. version identifiers, library search paths, etc.

Version identifiers are inherited downwards the dependency tree and string imports are too, but for legacy reasons. It's also possible to add some build flags by defining a custom build type, but that is only used if the package is built as the root package.

Another thing that can be overridden on the local machine on DUB 0.9.22-x is which dependencies are chosen, using dub add-override <package> <version-spec> <target-path/target-version>, or by editing the dub.selections.json of the root package.

All other build settings are generally defined only be each specific package.

  1. preBuildCommands/preGenerateCommands in dependencies seem to execute in the working directory of the current project, and not in the directory of corresponding dependencies. Could this be fixed please? =)

Good catch, I've created a ticket. As a workaround, you can use $PACKAGE_DIR or $ROOT_PACKAGE_DIR explicitly within the commands to access either the dependency's directory or the root package's directory.

Re: A couple of questions

  1. Ok, thanx for clarification.
  2. PACKAGE_DIR, how could i miss that. Works fine for me, thanx! Also i should note, that ROOT_PACKAGE_DIR is not mentioned in the documentation at http://code.dlang.org/package-format.