History

Prepended branch name to githash (tcc -v). WIN32: added githash support. - E.g. "tcc version 0.9.27 mob:675046b (x86_64 Windows)" - WIN32: Replaced compiler opt -O1 and -Os with -O2 (only 1% larger executable).

Tyge Løvset committed 5 years ago

Commit c7a57bf1 parent 675046b2 files · +11 −3Browse files

Unified · Split

2 files
  1. Makefile +1 −1
  2. win32/build-tcc.bat +10 −2
Makefile+1−1
@@ -224,7 +224,7 @@ endif · 223 unmodified lines
224 224
225GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)225GITHASH := $(shell git rev-parse >/dev/null 2>&1 && git rev-parse --short HEAD || echo no)
226ifneq ($(GITHASH),no)226ifneq ($(GITHASH),no)
227DEF_GITHASH := -DTCC_GITHASH="\"$(GITHASH)$(shell git diff --quiet || echo '-mod')\""227DEF_GITHASH := -DTCC_GITHASH="\"$(shell git rev-parse --abbrev-ref HEAD):$(GITHASH)$(shell git diff --quiet || echo '-mod')\""
228endif228endif
229 229
230ifeq ($(CONFIG_debug),yes)230ifeq ($(CONFIG_debug),yes)
win32/build-tcc.bat+10−2
@@ -7,6 +7,14 @@ setlocal · 6 unmodified lines
7if (%1)==(-clean) goto :cleanup7if (%1)==(-clean) goto :cleanup
8set CC=gcc8set CC=gcc
9set /p VERSION= < ..\VERSION9set /p VERSION= < ..\VERSION
10git.exe --version 2>nul
11if not %ERRORLEVEL%==0 goto :git_done
12for /f %%b in ('git.exe rev-parse --abbrev-ref HEAD') do set GITHASH=%%b
13for /f %%h in ('git.exe rev-parse --short HEAD') do set GITHASH=%GITHASH%:%%h
14git.exe diff --quiet
15if %ERRORLEVEL%==1 set GITHASH=%GITHASH%-mod
16set DEF_GITHASH=-DTCC_GITHASH="""%GITHASH%"""
17:git_done
10set INST=18set INST=
11set DOC=no19set DOC=no
12set EXES_ONLY=no20set EXES_ONLY=no
@@ -74,7 +82,7 @@ set CMD=%CMD% %ARG% · 61 unmodified lines
74shift82shift
75if not (%1)==() goto :c083if not (%1)==() goto :c0
76echo on84echo on
77%CMD% -O1 -W2 -Zi -MT -GS- -nologo -link -opt:ref,icf85%CMD% -O2 -W2 -Zi -MT -GS- -nologo %DEF_GITHASH% -link -opt:ref,icf
78@exit /B %ERRORLEVEL%86@exit /B %ERRORLEVEL%
79 87
80@rem ------------------------------------------------------88@rem ------------------------------------------------------
@@ -86,7 +94,7 @@ set T=32 · 5 unmodified lines
86if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=6494if %PROCESSOR_ARCHITECTURE%_==AMD64_ set T=64
87if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=6495if %PROCESSOR_ARCHITEW6432%_==AMD64_ set T=64
88:p296:p2
89if "%CC:~-3%"=="gcc" set CC=%CC% -Os -s -static97if "%CC:~-3%"=="gcc" set CC=%CC% -O2 -s -static %DEF_GITHASH%
90set D32=-DTCC_TARGET_PE -DTCC_TARGET_I38698set D32=-DTCC_TARGET_PE -DTCC_TARGET_I386
91set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_6499set D64=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
92set P32=i386-win32100set P32=i386-win32

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t