Skip to main content

linkbuildoutputs

Turns on/off the automatic linking of .obj files that are output by custom build commands. The default behaviour is to link .obj files when they are output by custom build commands.

linkbuildoutputs ("value")

Parameters

value is one of:

ValueDescription
OnAutomatically link object outputs from custom build commands.
OffDo not automatically link object outputs from custom build commands.

Applies To

Project configurations and rules.

Availability

Premake 5.0.0-alpha1 or later.

Examples

Use custom build commands to copy Wavefront .obj model files around without the linker trying to link them:

filter "**/models/**.obj"
-- Copy these files into the target directory while preserving the
-- folder structure.
buildcommands {
os.translateCommands '{mkdir} "%{ path.join(cfg.buildtarget.directory, path.getdirectory(file.relpath)) }"',
os.translateCommands '{copy} "%{ file.relpath }" "%{ path.join(cfg.buildtarget.directory, path.getdirectory(file.relpath)) }"'
}

buildoutputs "%{ path.join(cfg.buildtarget.directory, file.relpath) }"

-- The default behaviour is to link .obj if a custom build command
-- outputs them, but we don't want that since these are Wavefront .obj
-- model files and not object files.
linkbuildoutputs "Off"

See Also