Skip to content

v3.pref

fn comptime_flag_value #

fn comptime_flag_value(p &Preferences, name string) bool

comptime_flag_value supports comptime flag value handling for pref.

fn comptime_optional_flag_value #

fn comptime_optional_flag_value(p &Preferences, name string) bool

comptime_optional_flag_value supports comptime optional flag value handling for pref.

fn comptime_pkgconfig_value #

fn comptime_pkgconfig_value(name string) bool

comptime_pkgconfig_value supports comptime pkgconfig value handling for pref.

fn file_has_incompatible_os_suffix #

fn file_has_incompatible_os_suffix(file string, current_os string) bool

file_has_incompatible_os_suffix converts file has incompatible os suffix data for pref.

fn file_has_incompatible_target_suffix #

fn file_has_incompatible_target_suffix(file string, target Target) bool

file_has_incompatible_target_suffix reports whether an OS or architecture suffix excludes file from target.

fn get_test_v_files_from_dir #

fn get_test_v_files_from_dir(dir string, user_defines []string, backend string, target_os string) []string

get_test_v_files_from_dir returns backend/target/define-compatible test files in dir.

fn get_test_v_files_from_dir_for_target #

fn get_test_v_files_from_dir_for_target(dir string, user_defines []string, backend string, target Target) []string

get_test_v_files_from_dir_for_target returns tests compatible with the complete target.

fn get_v_files_from_dir #

fn get_v_files_from_dir(dir string, user_defines []string, target_os string) []string

get_v_files_from_dir returns get v files from dir data for pref.

fn get_v_files_from_dir_for_target #

fn get_v_files_from_dir_for_target(dir string, user_defines []string, target Target) []string

get_v_files_from_dir_for_target returns sources compatible with the complete target.

fn has_macos_v3_caller_environment #

fn has_macos_v3_caller_environment() bool

has_macos_v3_caller_environment reports whether the macOS driver transported the environment that should remain visible to compiled programs.

fn host_arch #

fn host_arch() string

host_arch returns the normalized architecture of the compiler process.

fn host_target #

fn host_target() Target

host_target returns the platform on which the compiler process is running.

fn is_test_file_for_backend #

fn is_test_file_for_backend(path string, backend string) bool

fn is_test_file_for_platform #

fn is_test_file_for_platform(path string, backend string, target Target) bool

is_test_file_for_platform reports whether path is a test for backend and target.

fn is_test_file_for_target #

fn is_test_file_for_target(path string, backend string, target_os string) bool

is_test_file_for_target reports whether path is a test file for backend that is compatible with target_os. Platform-qualified tests use names such as foo_windows_test.v and must not be added to a non-Windows test harness.

fn macos_v3_caller_env_value #

fn macos_v3_caller_env_value(name string) string

macos_v3_caller_env_value returns the caller-visible value for compile-time $env.

fn macos_v3_caller_environment #

fn macos_v3_caller_environment() map[string]string

macos_v3_caller_environment returns the environment that delegated run children should see.

fn new_preferences #

fn new_preferences() &Preferences

new_preferences supports new preferences handling for pref.

fn normalized_arch #

fn normalized_arch(target_arch string) string

normalized_arch canonicalizes common architecture aliases.

fn normalized_os #

fn normalized_os(target_os string) string

normalized_os supports normalized os handling for pref.

fn resolve_module_alias_path #

fn resolve_module_alias_path(search_root string, mod string) ?string

resolve_module_alias_path resolves @[alias: 'path'] module name declarations stored in alias.v. An alias applies to submodules as well.

fn target_from #

fn target_from(os_name string, arch_name string) !Target

target_from validates and canonicalizes an OS/architecture pair.

struct Preferences #

struct Preferences {
pub mut:
	verbose           bool
	output_file       string
	target            Target = host_target()
	user_defines      []string
	compile_values    map[string]string
	backend           string = 'c'
	ccompiler         string = 'gcc'
	c99               bool
	vroot             string = detect_vroot()
	vexe              string = detect_vexe()
	vhash             string
	vcurrent_hash     string
	selfhost          bool
	building_v        bool // compiling the V compiler itself: no generics, skip monomorphization
	is_prod           bool
	is_debug          bool
	is_test           bool // at least one compatible user test file is being compiled
	thread_stack_size int = 8 * 1024 * 1024
	// V3 backends currently do not lower V inline-assembly nodes. Keep this an
	// explicit capability so guarded stdlib assembly selects its software path.
	supports_inline_asm bool
pub:
	build_date      string
	build_time      string
	build_timestamp string
}

Preferences represents preferences data used by pref.

fn (Preferences) get_vlib_module_path #

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

get_vlib_module_path returns get vlib module path data for Preferences.

fn (Preferences) get_module_path #

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

get_module_path returns get module path data for Preferences.

fn (Preferences) normalized_target_os #

fn (p &Preferences) normalized_target_os() string

normalized_target_os supports normalized target os handling for Preferences.

fn (Preferences) normalized_target_arch #

fn (p &Preferences) normalized_target_arch() string

normalized_target_arch returns the canonical target architecture.

fn (Preferences) comptime_platform #

fn (p &Preferences) comptime_platform() string

comptime_platform returns the established @PLATFORM name for the selected target.

fn (Preferences) is_cross_target #

fn (p &Preferences) is_cross_target() bool

is_cross_target reports whether is cross target applies in pref.

struct Target #

struct Target {
pub:
	os            string
	arch          string
	abi           string
	endian        string
	pointer_bits  int
	object_format string
}

Target is the canonical description of the platform for which code is generated. Host properties must not be used for target-dependent source selection or semantics.

fn (Target) default_thread_stack_size #

fn (target Target) default_thread_stack_size() int

default_thread_stack_size returns the target-specific spawned-thread stack size.