v.builder #
fn compile #
fn compile(command string, pref_ &pref.Preferences, backend_cb FnBackend)
fn module_path #
fn module_path(mod string) string
fn new_builder #
fn new_builder(pref_ &pref.Preferences) Builder
fn verror #
fn verror(s string)
type FnBackend #
type FnBackend = fn (mut b Builder)
enum CC #
enum CC {
tcc
gcc
icc
msvc
clang
unknown
}
struct Builder #
struct Builder {
pub:
compiled_dir string // contains os.real_path() of the dir of the final file being compiled, or the dir itself when doing `v .`
module_path string
pub mut:
checker &checker.Checker = unsafe { nil }
transformer &transformer.Transformer = unsafe { nil }
out_name_c string
out_name_js string
stats_lines int // size of backend generated source code in lines
stats_bytes int // size of backend generated source code in bytes
nr_errors int // accumulated error count of scanner, parser, checker, and builder
nr_warnings int // accumulated warning count of scanner, parser, checker, and builder
nr_notices int // accumulated notice count of scanner, parser, checker, and builder
pref &pref.Preferences = unsafe { nil }
module_search_paths []string
parsed_files []&ast.File
//$if windows {
cached_msvc MsvcResult
//}
table &ast.Table = unsafe { nil }
ccoptions CcompilerOptions
// Note: changes in mod `builtin` force invalidation of every other .v file
mod_invalidates_paths map[string][]string // changes in mod `os`, invalidate only .v files, that do `import os`
mod_invalidates_mods map[string][]string // changes in mod `os`, force invalidation of mods, that do `import os`
path_invalidates_mods map[string][]string // changes in a .v file from `os`, invalidates `os`
crun_cache_keys []string // target executable + top level source files; filled in by Builder.should_rebuild
executable_exists bool // if the executable already exists, don't remove new executable after `v run`
str_args string // for parallel_cc mode only, to know which cc args to use (like -I etc)
}
fn (Builder) cc #
fn (mut v Builder) cc()
fn (Builder) dump_c_options #
fn (b &Builder) dump_c_options(all_args []string)
fn (Builder) dump_defines #
fn (b &Builder) dump_defines()
fn (Builder) dump_files #
fn (b &Builder) dump_files(files []string)
fn (Builder) dump_modules #
fn (b &Builder) dump_modules(mods []string)
fn (Builder) error_with_pos #
fn (b &Builder) error_with_pos(s string, fpath string, pos token.Pos) errors.Error
fn (Builder) find_invalidated_modules_by_files #
fn (mut b Builder) find_invalidated_modules_by_files(all_files []string) []string
fn (Builder) find_module_path #
fn (b &Builder) find_module_path(mod string, fpath string) !string
Todo: try to merge this & util.module functions to create areliable multi use function. see comments in util/module.v
fn (Builder) front_and_middle_stages #
fn (mut b Builder) front_and_middle_stages(v_files []string) !
fn (Builder) front_stages #
fn (mut b Builder) front_stages(v_files []string) !
fn (Builder) get_builtin_files #
fn (v Builder) get_builtin_files() []string
fn (Builder) get_compile_args #
fn (v &Builder) get_compile_args() []string
fn (Builder) get_linker_args #
fn (v &Builder) get_linker_args() []string
fn (Builder) get_user_files #
fn (v &Builder) get_user_files() []string
fn (Builder) get_vtmp_filename #
fn (mut b Builder) get_vtmp_filename(base_file_name string, postfix string) string
fn (Builder) import_graph #
fn (b &Builder) import_graph() &depgraph.DepGraph
graph of all imported modules
fn (Builder) info #
fn (b &Builder) info(s string)
fn (Builder) interpret_text #
fn (mut b Builder) interpret_text(code string, v_files []string) !
fn (Builder) log #
fn (b &Builder) log(s string)
fn (Builder) middle_stages #
fn (mut b Builder) middle_stages() !
fn (Builder) parse_imports #
fn (mut b Builder) parse_imports()
parse all deps from already parsed files
fn (Builder) print_warnings_and_errors #
fn (mut b Builder) print_warnings_and_errors()
fn (Builder) quote_compiler_name #
fn (mut v Builder) quote_compiler_name(name string) string
fn (Builder) rebuild #
fn (mut b Builder) rebuild(backend_cb FnBackend)
fn (Builder) rebuild_modules #
fn (mut b Builder) rebuild_modules()
fn (Builder) resolve_deps #
fn (mut b Builder) resolve_deps()
fn (Builder) set_module_lookup_paths #
fn (mut v Builder) set_module_lookup_paths()
'strings' => 'VROOT/vlib/strings' 'installed_mod' => '~/.vmodules/installed_mod' 'local_mod' => '/path/to/current/dir/local_mod'
fn (Builder) should_rebuild #
fn (mut b Builder) should_rebuild() bool
fn (Builder) show_total_warns_and_errors_stats #
fn (b &Builder) show_total_warns_and_errors_stats()
fn (Builder) v_files_from_dir #
fn (b &Builder) v_files_from_dir(dir string) []string
struct CcompilerOptions #
struct CcompilerOptions {
pub mut:
guessed_compiler string
shared_postfix string // .so, .dll
debug_mode bool
cc CC
env_cflags string // prepended *before* everything else
env_ldflags string // appended *after* everything else
args []string // ordinary C options like `-O2`
wargs []string // for `-Wxyz` *exclusively*
pre_args []string // options that should go before .o_args
o_args []string // for `-o target`
source_args []string // for `x.tmp.c`
post_args []string // options that should go after .o_args
linker_flags []string // `-lm`
ldflags []string // `-labcd' from `v -ldflags "-labcd"`
}
- fn compile
- fn module_path
- fn new_builder
- fn verror
- type FnBackend
- enum CC
- struct Builder
- fn cc
- fn dump_c_options
- fn dump_defines
- fn dump_files
- fn dump_modules
- fn error_with_pos
- fn find_invalidated_modules_by_files
- fn find_module_path
- fn front_and_middle_stages
- fn front_stages
- fn get_builtin_files
- fn get_compile_args
- fn get_linker_args
- fn get_user_files
- fn get_vtmp_filename
- fn import_graph
- fn info
- fn interpret_text
- fn log
- fn middle_stages
- fn parse_imports
- fn print_warnings_and_errors
- fn quote_compiler_name
- fn rebuild
- fn rebuild_modules
- fn resolve_deps
- fn set_module_lookup_paths
- fn should_rebuild
- fn show_total_warns_and_errors_stats
- fn v_files_from_dir
- struct CcompilerOptions