include_dependency
include_dependency(path::AbstractString)
In a module, declare that the file specified by path
(relative or absolute) is a dependency for precompilation; that is, the module will need to be recompiled if this file changes.
This is only needed if your module depends on a file that is not used via include
. It has no effect outside of compilation.
Examples
include_dependency(path::AbstractString)
In a module, declare that the file specified by path
(relative or absolute) is a dependency for precompilation. This means that if the specified file changes, the module will be recompiled to incorporate the changes.
Note that this function is only necessary if your module has a dependency on a file that is not included directly using the include
function. It has no effect outside of compilation.
Example:
module MyModule
include_dependency("dependencies.jl")
# Rest of the module code
# ...
end
In this example, the module MyModule
declares that the file "dependencies.jl" is a dependency for precompilation. If the "dependencies.jl" file is modified, the module will be recompiled to reflect the changes.
It is important to use include_dependency
only when necessary, i.e., when your module has external dependencies that are not included via include
.
See Also
assert, backtrace, code_llvm, code_lowered, code_native, code_typed, code_warntype, :@which, compilecache, current_module, eval, finalize, finalizer, fullname, function_module, function_name, include_dependency, InterruptException, invoke, isconst, isdefined, isgeneric, methodswith, method_exists, module_name, module_parent, require, subtypes, unsafe_load, workspace, __precompile__,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.