We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 025e703 commit e9c2314Copy full SHA for e9c2314
1 file changed
vlib/v/pref/default.v
@@ -377,3 +377,11 @@ pub fn (p &Preferences) vcross_compiler_name() string {
377
}
378
return 'cc'
379
380
+
381
+// vroot_file reads the given file, given a path relative to @VROOT .
382
+// Its goal is to give all backends a shared infrastructure to read their own static preludes (like C headers etc),
383
+// without each having to implement their own way of lookup/embedding/caching them.
384
+pub fn (mut p Preferences) vroot_file(path string) string {
385
+ full_path := os.join_path(p.vroot, path)
386
+ return os.read_file(full_path) or { '/* missing vroot content of path: ${full_path} */' }
387
+}
0 commit comments