@@ -404,6 +404,72 @@ function CreateProject(config)
404
404
postbuildcommands ({" {COPY} \" %{cfg.buildtarget.abspath}\" \" " .. binDir .. " \" " })
405
405
end
406
406
407
+ local debug_path = _OPTIONS [" debug-path" ]
408
+ if debug_path ~= nil then
409
+ local client_args = {" -steam" , " -game" , " garrysmod" }
410
+ local server_args = {
411
+ " -console" ,
412
+ " -game" , " garrysmod" ,
413
+ " -ip" , " localhost" ,
414
+ " -port" , " 27015" ,
415
+ " +gamemode" , " sandbox" ,
416
+ " +map" , " gm_construct" ,
417
+ " +maxplayers" , " 16"
418
+ }
419
+ local args = is_server and server_args or client_args
420
+
421
+ if PROJECT_GENERATOR_VERSION < 3 then
422
+ filter ({" system:windows" , " platforms:x86" })
423
+ debugcommand (path .join (debug_path , is_server and " srcds.exe" or " hl2.exe" ))
424
+ debugdir (debug_path )
425
+ debugargs (args )
426
+
427
+ filter ({" system:linux" , " platforms:x86" })
428
+ debugcommand (path .join (debug_path , is_server and " srcds_linux" or " hl2_linux" ))
429
+ debugdir (debug_path )
430
+ debugargs (args )
431
+ debugenvs ({" LD_LIBRARY_PATH=\" .:bin:garrysmod/bin:$LD_LIBRARY_PATH\" " })
432
+
433
+ if not is_server then
434
+ filter ({" system:macosx" , " platforms:x86" })
435
+ debugcommand (path .join (debug_path , " hl2_osx" ))
436
+ debugdir (debug_path )
437
+ debugargs (args )
438
+ end
439
+ else
440
+ filter ({" system:windows" , " platforms:x86" })
441
+ debugcommand (path .join (debug_path , is_server and " srcds.exe" or " bin/gmod.exe" ))
442
+ debugdir (debug_path )
443
+ debugargs (args )
444
+
445
+ filter ({" system:windows" , " platforms:x86_64" })
446
+ debugcommand (path .join (debug_path , is_server and " srcds_win64.exe" or " bin/win64/gmod.exe" ))
447
+ debugdir (debug_path )
448
+ debugargs (args )
449
+
450
+ if is_server then
451
+ filter ({" system:linux" , " platforms:x86" })
452
+ debugcommand (path .join (debug_path , " bin/linux32/srcds" ))
453
+ debugdir (debug_path )
454
+ debugargs (args )
455
+ debugenvs ({" LD_LIBRARY_PATH=\" .:bin/linux32:$LD_LIBRARY_PATH\" " })
456
+ end
457
+
458
+ filter ({" system:linux" , " platforms:x86_64" })
459
+ debugcommand (path .join (debug_path , is_server and " bin/linux64/srcds" or " bin/linux64/gmod" ))
460
+ debugdir (debug_path )
461
+ debugargs (args )
462
+ debugenvs ({" LD_LIBRARY_PATH=\" .:bin/linux64:$LD_LIBRARY_PATH\" " })
463
+
464
+ if not is_server then
465
+ filter ({" system:macosx" , " platforms:x86_64" })
466
+ debugcommand (path .join (debug_path , " GarrysMod_Signed.app/Contents/MacOS/gmod" ))
467
+ debugdir (debug_path )
468
+ debugargs (args )
469
+ end
470
+ end
471
+ end
472
+
407
473
IncludeHelpers ()
408
474
409
475
filter ({})
0 commit comments