Skip to content

Commit b45f2b6

Browse files
committed
pref: cleanup dead code, fix a bug when a project named v was compiled without GC by default (make that heuristic much more specific to V itself)
1 parent 6e0c48a commit b45f2b6

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

vlib/v/pref/default.v

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,9 @@ pub fn (mut p Preferences) fill_with_defaults() {
140140
// If you do decide to break it, please *at the very least*, test it
141141
// extensively, and make a PR about it, instead of committing directly
142142
// and breaking the CI, VC, and users doing `v up`.
143-
if rpath == '${p.vroot}/cmd/v' && os.is_dir('vlib/compiler') {
144-
// Building V? Use v2, since we can't overwrite a running
145-
// executable on Windows + the precompiled V is more
146-
// optimized.
147-
println('Saving the resulting V executable in `./v2`')
148-
println('Use `v -o v cmd/v` if you want to replace current ' + 'V executable.')
149-
p.out_name = 'v2'
150-
}
151143
}
152-
rpath_name := os.file_name(rpath)
153-
p.building_v = !p.is_repl && (rpath_name == 'v' || rpath_name == 'vfmt.v')
144+
npath := rpath.replace('\\', '/')
145+
p.building_v = !p.is_repl && (npath.ends_with('cmd/v') || npath.ends_with('cmd/tools/vfmt.v'))
154146
if p.os == .linux {
155147
$if !linux {
156148
p.parse_define('cross_compile')

0 commit comments

Comments
 (0)