Skip to content

v2.pref #

fn new_preferences #

fn new_preferences() Preferences

fn new_preferences_from_args #

fn new_preferences_from_args(args []string) Preferences

new_preferences_from_args parses full args list including option values

fn new_preferences_using_options #

fn new_preferences_using_options(options []string) Preferences

enum Arch #

enum Arch {
	auto // Auto-detect based on OS
	x64
	arm64
}

enum Backend #

enum Backend {
	v      // V source output (default)
	cleanc // Clean C backend (AST -> C)
	x64    // Native x64/AMD64 backend
	arm64  // Native ARM64 backend
}

struct Preferences #

struct Preferences {
pub mut:
	debug                 bool
	verbose               bool
	skip_genv             bool
	skip_builtin          bool
	skip_imports          bool
	skip_type_check       bool // Skip type checking phase (for backends that don't need it yet)
	no_parallel           bool = true // default to sequential parsing until parallel is fixed
	keep_c                bool // Keep generated C file after compilation
	use_context_allocator bool // Use context allocator for heap allocations (enables profiling)
	backend               Backend
	arch                  Arch = .auto
	output_file           string
	printfn_list          []string // List of function names whose generated C source should be printed
pub:
	vroot         string = os.dir(@)
	vmodules_path string = os.vmodules_dir()
}

fn (Preferences) get_effective_arch #

fn (p &Preferences) get_effective_arch() Arch

get_effective_arch returns the architecture to use based on preferences and OS

fn (Preferences) get_module_path #

fn (p &Preferences) get_module_path(mod string, importing_file_path string) string

check for relative and then vlib

fn (Preferences) get_vlib_module_path #

fn (p &Preferences) get_vlib_module_path(mod string) string