dub.compilers.utils

Utility functionality for compiler class implementations.

Members

Functions

addDynamicLibName
void addDynamicLibName(BuildSettings settings, BuildPlatform platform, string fileName)

Adds a default DT_SONAME (ELF) / 'install name' (Mach-O) when linking a dynamic library. This makes dependees reference their dynamic-lib deps by filename only (DT_NEEDED etc.) instead of by the path used in the dependee linker cmdline, and enables loading the deps from the dependee's output directory - either by setting the LD_LIBRARY_PATH environment variable, or baking an rpath into the executable.

dmdLikeVersionToSemverLike
string dmdLikeVersionToSemverLike(string ver)

Turn a DMD-like version (e.g. 2.082.1) into a SemVer-like version (e.g. 2.82.1). The function accepts a dependency operator prefix and some text postfix. Prefix and postfix are returned verbatim.

enforceBuildRequirements
void enforceBuildRequirements(BuildSettings settings)

Alters the build options to comply with the specified build requirements.

generatePlatformProbeFile
NativePath generatePlatformProbeFile()

Generate a file that will give, at compile time, information about the compiler (architecture, frontend version...)

isLinkerFile
bool isLinkerFile(BuildPlatform platform, string f)

Determines if a specific file name has the extension of a linker file.

readPlatformJsonProbe
BuildPlatform readPlatformJsonProbe(string output)

Processes the JSON output generated by compiling the platform probe file.

resolveLibs
void resolveLibs(BuildSettings settings, BuildPlatform platform)

Replaces each referenced import library by the appropriate linker flags.

warnOnSpecialCompilerFlags
void warnOnSpecialCompilerFlags(string[] compiler_flags, Flags!BuildOption options, string package_name, string config_name)

Searches the given list of compiler flags for ones that have a generic equivalent.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig