| LdFlagsFile | R Documentation |
On Windows the full set of VTK linker flags can exceed the 8 191-character
Windows command-line limit, causing the linker to drop flags at the end of
the list. This function writes the flags to a plain-text response file that
the linker reads via the @file syntax, keeping the command line short.
LdFlagsFile(path, os_type = .Platform$OS.type)
path |
Path (relative to the package source root, i.e. where
|
os_type |
A string identifying the operating-system type, defaulting to
|
Intended to be called from a downstream package's configure or
configure.win script:
VTK_LIBS="$("${R_HOME}/bin/Rscript" --vanilla -e \
"rvtk::LdFlagsFile('src/vtk_libs.rsp')")"
# VTK_LIBS is now the short string "@src/vtk_libs.rsp" on Windows,
# or the raw flags on macOS/Linux.
On Windows the flags are written to path and the function returns the
@basename(path) token for the linker. On macOS and Linux, ld does not
reliably support @file response files at the compiler-driver level, so
no file is written and the raw flags are returned directly.
Invisibly, the string to embed in configure (either
@basename(path) on Windows or the raw flags on other platforms). The
string is also written to stdout so that shell command substitution
captures it.
rsp <- file.path(tempdir(), "vtk_libs.rsp")
ref <- LdFlagsFile(rsp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.