mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 22:10:24 +00:00
Log C++ errors to temp/compile.log for Linux/OSX
This commit is contained in:
parent
40c2ab73f6
commit
ecd1897c44
|
@ -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 AS _BYTE
|
||||||
DIM SHARED optionexplicit_cmd AS _BYTE
|
DIM SHARED optionexplicit_cmd AS _BYTE
|
||||||
DIM SHARED outputfile_cmd$
|
DIM SHARED outputfile_cmd$
|
||||||
|
DIM SHARED compilelog$
|
||||||
|
|
||||||
'$INCLUDE:'global\IDEsettings.bas'
|
'$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
|
FOR closeall = 1 TO 255: CLOSE closeall: NEXT
|
||||||
OPEN tmpdir$ + "temp.bin" FOR OUTPUT LOCK WRITE AS #26 'relock
|
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")
|
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
|
ELSE
|
||||||
IF mac THEN
|
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
|
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
|
||||||
END IF
|
END IF
|
||||||
CHDIR "..\.."
|
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
|
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"
|
a$ = a$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
|
||||||
CHDIR ".\internal\c"
|
CHDIR ".\internal\c"
|
||||||
SHELL _HIDE a$
|
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
|
||||||
CHDIR "..\.."
|
CHDIR "..\.."
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
@ -12495,7 +12497,7 @@ IF os$ = "LNX" THEN
|
||||||
|
|
||||||
IF No_C_Compile_Mode = 0 THEN
|
IF No_C_Compile_Mode = 0 THEN
|
||||||
CHDIR "./internal/c"
|
CHDIR "./internal/c"
|
||||||
SHELL _HIDE a$
|
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
|
||||||
CHDIR "../.."
|
CHDIR "../.."
|
||||||
IF idemode THEN
|
IF idemode THEN
|
||||||
'Restore fg/bg colors
|
'Restore fg/bg colors
|
||||||
|
@ -12529,10 +12531,13 @@ IF _FILEEXISTS(path.exe$ + file$ + extension$) THEN compfailed = 0 ELSE compfail
|
||||||
|
|
||||||
IF compfailed THEN
|
IF compfailed THEN
|
||||||
IF idemode THEN
|
IF idemode THEN
|
||||||
idemessage$ = "C++ Compilation failed"
|
idemessage$ = "C++ Compilation failed (Check " + compilelog$ + ")"
|
||||||
GOTO ideerror
|
GOTO ideerror
|
||||||
END IF
|
END IF
|
||||||
IF compfailed THEN PRINT "C++ COMPILATION FAILED!"
|
IF compfailed THEN
|
||||||
|
PRINT "C++ COMPILATION FAILED!"
|
||||||
|
PRINT "Check " + compilelog$ + " for details."
|
||||||
|
END IF
|
||||||
ELSE
|
ELSE
|
||||||
IF idemode = 0 THEN PRINT "OUTPUT: "; path.exe$ + file$ + extension$
|
IF idemode = 0 THEN PRINT "OUTPUT: "; path.exe$ + file$ + extension$
|
||||||
END IF
|
END IF
|
||||||
|
@ -23219,16 +23224,10 @@ END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB Build (path$)
|
SUB Build (path$)
|
||||||
|
previous_dir$ = _CWD$
|
||||||
'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
|
|
||||||
CHDIR path$
|
CHDIR path$
|
||||||
|
|
||||||
bfh = FREEFILE
|
bfh = FREEFILE
|
||||||
|
|
||||||
OPEN "build" + BATCHFILE_EXTENSION FOR BINARY AS #bfh
|
OPEN "build" + BATCHFILE_EXTENSION FOR BINARY AS #bfh
|
||||||
DO UNTIL EOF(bfh)
|
DO UNTIL EOF(bfh)
|
||||||
LINE INPUT #bfh, c$
|
LINE INPUT #bfh, c$
|
||||||
|
@ -23243,17 +23242,13 @@ DO UNTIL EOF(bfh)
|
||||||
IF os$ = "WIN" THEN
|
IF os$ = "WIN" THEN
|
||||||
SHELL _HIDE "cmd /C " + c$
|
SHELL _HIDE "cmd /C " + c$
|
||||||
ELSE
|
ELSE
|
||||||
SHELL _HIDE c$
|
SHELL _HIDE c$ + " 2>> " + previous_dir$ + "/" + compilelog$
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
LOOP
|
LOOP
|
||||||
CLOSE #bfh
|
CLOSE #bfh
|
||||||
|
|
||||||
return_path$ = ".."
|
CHDIR previous_dir$
|
||||||
FOR x = 2 TO depth
|
|
||||||
return_path$ = return_path$ + "\.."
|
|
||||||
NEXT
|
|
||||||
CHDIR return_path$
|
|
||||||
|
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue