Version 3.1: Fix building Qt for Release.
This commit is contained in:
parent
7ce8b42216
commit
2ec92f541c
|
@ -246,23 +246,26 @@ def winFailOnEach(command):
|
||||||
result = result + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%\r\n'
|
result = result + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%\r\n'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def run(command):
|
def printCommands(commands):
|
||||||
print('---------------------------------COMMANDS-LIST----------------------------------')
|
print('---------------------------------COMMANDS-LIST----------------------------------')
|
||||||
print(command, end='')
|
print(commands, end='')
|
||||||
print('--------------------------------------------------------------------------------')
|
print('--------------------------------------------------------------------------------')
|
||||||
|
|
||||||
|
def run(commands):
|
||||||
|
printCommands(commands)
|
||||||
if win:
|
if win:
|
||||||
if os.path.exists("command.bat"):
|
if os.path.exists("command.bat"):
|
||||||
os.remove("command.bat")
|
os.remove("command.bat")
|
||||||
with open("command.bat", 'w') as file:
|
with open("command.bat", 'w') as file:
|
||||||
file.write('@echo OFF\r\n' + winFailOnEach(command))
|
file.write('@echo OFF\r\n' + winFailOnEach(commands))
|
||||||
result = subprocess.run("command.bat", shell=True, env=modifiedEnv).returncode == 0
|
result = subprocess.run("command.bat", shell=True, env=modifiedEnv).returncode == 0
|
||||||
if result and os.path.exists("command.bat"):
|
if result and os.path.exists("command.bat"):
|
||||||
os.remove("command.bat")
|
os.remove("command.bat")
|
||||||
return result
|
return result
|
||||||
elif re.search(r'\%', command):
|
elif re.search(r'\%', commands):
|
||||||
error('Bad command: ' + command)
|
error('Bad command: ' + commands)
|
||||||
else:
|
else:
|
||||||
return subprocess.run("set -e\n" + command, shell=True, env=modifiedEnv).returncode == 0
|
return subprocess.run("set -e\n" + commands, shell=True, env=modifiedEnv).returncode == 0
|
||||||
|
|
||||||
# Thanks https://stackoverflow.com/a/510364
|
# Thanks https://stackoverflow.com/a/510364
|
||||||
class _Getch:
|
class _Getch:
|
||||||
|
@ -328,6 +331,7 @@ def runStages():
|
||||||
prefix = '[' + str(index) + '/' + str(count) + '](' + stage['location'] + '/' + stage['name'] + version + ')'
|
prefix = '[' + str(index) + '/' + str(count) + '](' + stage['location'] + '/' + stage['name'] + version + ')'
|
||||||
print(prefix + ': ', end = '', flush=True)
|
print(prefix + ': ', end = '', flush=True)
|
||||||
stage['key'] = computeCacheKey(stage)
|
stage['key'] = computeCacheKey(stage)
|
||||||
|
commands = removeDir(stage['name']) + '\n' + stage['commands']
|
||||||
checkResult = 'Forced' if len(onlyStages) > 0 else checkCacheKey(stage)
|
checkResult = 'Forced' if len(onlyStages) > 0 else checkCacheKey(stage)
|
||||||
if checkResult == 'Good':
|
if checkResult == 'Good':
|
||||||
print('SKIPPING')
|
print('SKIPPING')
|
||||||
|
@ -340,11 +344,15 @@ def runStages():
|
||||||
if rebuildStale:
|
if rebuildStale:
|
||||||
checkResult == 'Rebuild'
|
checkResult == 'Rebuild'
|
||||||
else:
|
else:
|
||||||
print('(r)ebuild, rebuild (a)ll, (s)kip, (q)uit?: ', end='', flush=True)
|
print('(r)ebuild, rebuild (a)ll, (s)kip, (p)rint, (q)uit?: ', end='', flush=True)
|
||||||
while True:
|
while True:
|
||||||
ch = 'r' if rebuildStale else getch()
|
ch = 'r' if rebuildStale else getch()
|
||||||
if ch == 'q':
|
if ch == 'q':
|
||||||
finish(0)
|
finish(0)
|
||||||
|
elif ch == 'p':
|
||||||
|
printCommands(commands)
|
||||||
|
checkResult = 'Printed'
|
||||||
|
break
|
||||||
elif ch == 's':
|
elif ch == 's':
|
||||||
checkResult = 'Skip'
|
checkResult = 'Skip'
|
||||||
break
|
break
|
||||||
|
@ -355,13 +363,14 @@ def runStages():
|
||||||
checkResult = 'Rebuild'
|
checkResult = 'Rebuild'
|
||||||
rebuildStale = True
|
rebuildStale = True
|
||||||
break
|
break
|
||||||
|
if checkResult == 'Printed':
|
||||||
|
continue
|
||||||
if checkResult == 'Skip':
|
if checkResult == 'Skip':
|
||||||
print('SKIPPING')
|
print('SKIPPING')
|
||||||
continue
|
continue
|
||||||
clearCacheKey(stage)
|
clearCacheKey(stage)
|
||||||
print('BUILDING:')
|
print('BUILDING:')
|
||||||
os.chdir(stage['directory'])
|
os.chdir(stage['directory'])
|
||||||
commands = removeDir(stage['name']) + '\n' + stage['commands']
|
|
||||||
if not run(commands):
|
if not run(commands):
|
||||||
print(prefix + ': FAILED')
|
print(prefix + ': FAILED')
|
||||||
finish(1)
|
finish(1)
|
||||||
|
@ -793,9 +802,9 @@ win:
|
||||||
for /r %%i in (..\\..\\patches\\qtbase_5_15_2\\*) do git apply %%i
|
for /r %%i in (..\\..\\patches\\qtbase_5_15_2\\*) do git apply %%i
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
SET CONFIGURATIONS=-debug-and-release
|
|
||||||
release:
|
|
||||||
SET CONFIGURATIONS=-debug
|
SET CONFIGURATIONS=-debug
|
||||||
|
release:
|
||||||
|
SET CONFIGURATIONS=-debug-and-release
|
||||||
win:
|
win:
|
||||||
SET ANGLE_DIR=%LIBS_DIR%\\tg_angle
|
SET ANGLE_DIR=%LIBS_DIR%\\tg_angle
|
||||||
SET ANGLE_LIBS_DIR=%ANGLE_DIR%\\out
|
SET ANGLE_LIBS_DIR=%ANGLE_DIR%\\out
|
||||||
|
@ -837,9 +846,9 @@ mac:
|
||||||
find ../../patches/qtbase_5_15_2 -type f -print0 | sort -z | xargs -0 git apply
|
find ../../patches/qtbase_5_15_2 -type f -print0 | sort -z | xargs -0 git apply
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
CONFIGURATIONS=-debug-and-release
|
|
||||||
release:
|
|
||||||
CONFIGURATIONS=-debug
|
CONFIGURATIONS=-debug
|
||||||
|
release:
|
||||||
|
CONFIGURATIONS=-debug-and-release
|
||||||
mac:
|
mac:
|
||||||
./configure -prefix "$USED_PREFIX/Qt-5.15.2" \
|
./configure -prefix "$USED_PREFIX/Qt-5.15.2" \
|
||||||
$CONFIGURATIONS \
|
$CONFIGURATIONS \
|
||||||
|
|
Loading…
Reference in New Issue