1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-02 03:50:36 +00:00

Log C++ errors to temp/compile.log for Linux/OSX

This commit is contained in:
Luke Ceddia 2017-10-15 01:03:38 +11:00
parent 40c2ab73f6
commit ecd1897c44

View file

@ -339,6 +339,7 @@ DIM SHARED idemessage AS STRING 'set by qb64-error(...) to the error message to
DIM SHARED optionexplicit AS _BYTE
DIM SHARED optionexplicit_cmd AS _BYTE
DIM SHARED outputfile_cmd$
DIM SHARED compilelog$
'$INCLUDE:'global\IDEsettings.bas'
@ -11615,7 +11616,8 @@ IF Debug THEN PRINT #9, "Finished generation of code for saving/sharing common a
FOR closeall = 1 TO 255: CLOSE closeall: NEXT
OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26 'relock
compilelog$ = tmpdir$ + "compile.log"
OPEN compilelog$ FOR OUTPUT AS #1: CLOSE #1 'Clear log
@ -11883,9 +11885,9 @@ IF _FILEEXISTS("internal\c\" + LTRIM$(RTRIM$(libqb$))) = 0 THEN
SHELL _HIDE GDB_Fix("cmd /c c_compiler\bin\g++ -c -s -w -Wall libqb.cpp -D FREEGLUT_STATIC " + defines$ + " -o libqb\os\" + o$ + "\libqb_" + depstr$ + ".o")
ELSE
IF mac THEN
SHELL _HIDE GDB_Fix("g++ -c -s -w -Wall libqb.mm " + defines$ + " -o libqb/os/" + o$ + "/libqb_" + depstr$ + ".o")
SHELL _HIDE GDB_Fix("g++ -c -s -w -Wall libqb.mm " + defines$ + " -o libqb/os/" + o$ + "/libqb_" + depstr$ + ".o") + " 2>> ../../" + compilelog$
ELSE
SHELL _HIDE GDB_Fix("g++ -c -s -w -Wall libqb.cpp -D FREEGLUT_STATIC " + defines$ + " -o libqb/os/" + o$ + "/libqb_" + depstr$ + ".o")
SHELL _HIDE GDB_Fix("g++ -c -s -w -Wall libqb.cpp -D FREEGLUT_STATIC " + defines$ + " -o libqb/os/" + o$ + "/libqb_" + depstr$ + ".o") + " 2>> ../../" + compilelog$
END IF
END IF
CHDIR "..\.."
@ -12349,7 +12351,7 @@ IF os$ = "LNX" THEN
OPEN ".\internal\c\makedat_lnx" + b$ + ".txt" FOR BINARY AS #150: LINE INPUT #150, a$: CLOSE #150
a$ = a$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
CHDIR ".\internal\c"
SHELL _HIDE a$
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
CHDIR "..\.."
END IF
END IF
@ -12495,7 +12497,7 @@ IF os$ = "LNX" THEN
IF No_C_Compile_Mode = 0 THEN
CHDIR "./internal/c"
SHELL _HIDE a$
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
CHDIR "../.."
IF idemode THEN
'Restore fg/bg colors
@ -12529,10 +12531,13 @@ IF _FILEEXISTS(path.exe$ + file$ + extension$) THEN compfailed = 0 ELSE compfail
IF compfailed THEN
IF idemode THEN
idemessage$ = "C++ Compilation failed"
idemessage$ = "C++ Compilation failed (Check " + compilelog$ + ")"
GOTO ideerror
END IF
IF compfailed THEN PRINT "C++ COMPILATION FAILED!"
IF compfailed THEN
PRINT "C++ COMPILATION FAILED!"
PRINT "Check " + compilelog$ + " for details."
END IF
ELSE
IF idemode = 0 THEN PRINT "OUTPUT: "; path.exe$ + file$ + extension$
END IF
@ -23219,16 +23224,10 @@ END IF
END SUB
SUB Build (path$)
'Count the separators in the path
depth = 1
FOR x = 1 TO LEN(path$)
IF ASC(path$, x) = 92 OR ASC(path$, x) = 47 THEN depth = depth + 1
NEXT
previous_dir$ = _CWD$
CHDIR path$
bfh = FREEFILE
OPEN "build" + BATCHFILE_EXTENSION FOR BINARY AS #bfh
DO UNTIL EOF(bfh)
LINE INPUT #bfh, c$
@ -23243,17 +23242,13 @@ DO UNTIL EOF(bfh)
IF os$ = "WIN" THEN
SHELL _HIDE "cmd /C " + c$
ELSE
SHELL _HIDE c$
SHELL _HIDE c$ + " 2>> " + previous_dir$ + "/" + compilelog$
END IF
END IF
LOOP
CLOSE #bfh
return_path$ = ".."
FOR x = 2 TO depth
return_path$ = return_path$ + "\.."
NEXT
CHDIR return_path$
CHDIR previous_dir$
END SUB