Skip to content

Commit abcd944

Browse files
committed
Add warning for relative source paths in cppia
1 parent 72f6460 commit abcd944

File tree

1 file changed

+10
-0
lines changed
  • hxcpp-debug-server/hxcpp/debug/jsonrpc

1 file changed

+10
-0
lines changed

hxcpp-debug-server/hxcpp/debug/jsonrpc/Server.hx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,21 @@ class Server {
235235
}
236236

237237
private function generateFilePathMaps() {
238+
#if scriptable
239+
var isUpdate = path2file.keys().hasNext();
240+
#end
238241
var fullPathes = Debugger.getFilesFullPath();
239242
var files = Debugger.getFiles();
240243
for (i in 0...files.length) {
241244
var file = files[i];
242245
var path = fullPathes[i];
246+
247+
#if scriptable
248+
if (isUpdate && !path2file.exists(path2Key(path)) && !haxe.io.Path.isAbsolute(path)) {
249+
log("Warning: cppia script was loaded containing relative source file paths. Make sure the script is compiled with -D cppia.absolute-source-paths");
250+
}
251+
#end
252+
243253
path2file[path2Key(path)] = file;
244254
file2path[path2Key(file)] = path;
245255
}

0 commit comments

Comments
 (0)