1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix v -live -cc gcc examples/hot_reload/graph.v

This commit is contained in:
Delyan Angelov 2022-11-11 09:44:40 +02:00
parent 3a85955d22
commit 202f9574ec
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 5 additions and 8 deletions

View File

@ -80,9 +80,9 @@ fn (mut g Gen) generate_hotcode_reloading_main_caller() {
} }
vexe := util.cescaped_path(pref.vexe_path()) vexe := util.cescaped_path(pref.vexe_path())
file := util.cescaped_path(g.pref.path) file := util.cescaped_path(g.pref.path)
msvc := if g.pref.ccompiler == 'msvc' { '-cc msvc' } else { '' } ccompiler := '-cc $g.pref.ccompiler'
so_debug_flag := if g.pref.is_debug { '-cg' } else { '' } so_debug_flag := if g.pref.is_debug { '-cg' } else { '' }
vopts := '$msvc $so_debug_flag -sharedlive -shared' vopts := '$ccompiler $so_debug_flag -sharedlive -shared'
// //
g.writeln('\t\t// start background reloading thread') g.writeln('\t\t// start background reloading thread')
if g.pref.os == .windows { if g.pref.os == .windows {

View File

@ -5,9 +5,7 @@ import time
import dl import dl
import v.live import v.live
pub const ( pub const is_used = 1
is_used = 1
)
// The live reloader code is implemented here. // The live reloader code is implemented here.
// Note: new_live_reload_info will be called by generated C code inside main() // Note: new_live_reload_info will be called by generated C code inside main()
@ -48,10 +46,9 @@ pub fn start_reloader(mut r live.LiveReloadInfo) {
spawn reloader(mut r) spawn reloader(mut r)
} }
[if debuglive ?]
fn elog(r &live.LiveReloadInfo, s string) { fn elog(r &live.LiveReloadInfo, s string) {
$if debuglive ? { eprintln(s)
eprintln(s)
}
} }
fn compile_and_reload_shared_lib(mut r live.LiveReloadInfo) !bool { fn compile_and_reload_shared_lib(mut r live.LiveReloadInfo) !bool {