live: make compile; pref: allow _linux.v etc

pull/4805/head
Alexander Medvednikov 2020-05-09 20:31:50 +02:00
parent d7c4630d33
commit 3052266a40
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ pub:
live_linkfn FNLinkLiveSymbols // generated C callback; receives a dlopen handle
so_extension string // .so or .dll
so_name_template string // a sprintf template for the shared libraries location
mut:
pub mut:
live_lib voidptr // the result of dl.open
reloads int // how many times a reloading was tried
reloads_ok int // how many times the reloads succeeded

View File

@ -41,13 +41,13 @@ pub fn (prefs &Preferences) should_compile_c(file string) bool {
// Probably something like `a.js.v`.
return false
}
if file.ends_with('_windows.c.v') && prefs.os != .windows {
if (file.ends_with('_windows.c.v') || file.ends_with('_windows.v')) && prefs.os != .windows {
return false
}
if file.ends_with('_linux.c.v') && prefs.os != .linux {
if (file.ends_with('_linux.c.v') || file.ends_with('_linux.v')) && prefs.os != .linux {
return false
}
if file.ends_with('_darwin.c.v') && prefs.os != .mac {
if (file.ends_with('_darwin.c.v') || file.ends_with('_darwin.v')) && prefs.os != .mac {
return false
}
if file.ends_with('_nix.c.v') && prefs.os == .windows {