1
0
Fork 0

Split build types by folders for GCC.

This commit is contained in:
23rd 2019-12-15 03:37:27 +03:00
parent d1c4976d3d
commit 1dd11ff72a

View file

@ -7,21 +7,23 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
''' '''
import sys, os, shutil, subprocess import sys, os, shutil, subprocess
def run(project, arguments): def run(project, arguments, buildType=''):
scriptPath = os.path.dirname(os.path.realpath(__file__)) scriptPath = os.path.dirname(os.path.realpath(__file__))
basePath = scriptPath + '/../out' basePath = scriptPath + '/../out/' + buildType
cmake = ['cmake'] cmake = ['cmake']
for arg in arguments: for arg in arguments:
if arg == 'debug': if arg == 'debug':
cmake.append('-DCMAKE_BUILD_TYPE=Debug') cmake.append('-DCMAKE_BUILD_TYPE=Debug')
elif arg != 'force': elif arg != 'force':
cmake.append(arg) cmake.append(arg)
if sys.platform == 'win32': if sys.platform == 'win32':
cmake.append('-AWin32') cmake.append('-AWin32')
elif sys.platform == 'darwin': elif sys.platform == 'darwin':
cmake.append('-GXcode') cmake.append('-GXcode')
elif buildType:
cmake.append('-DCMAKE_BUILD_TYPE=' + buildType)
elif not '-DCMAKE_BUILD_TYPE=Debug' in cmake: elif not '-DCMAKE_BUILD_TYPE=Debug' in cmake:
cmake.append('-DCMAKE_BUILD_TYPE=Release') cmake.append('-DCMAKE_BUILD_TYPE=Release')
@ -34,11 +36,11 @@ def run(project, arguments):
if len(target) > 0: if len(target) > 0:
cmake.append('-DDESKTOP_APP_SPECIAL_TARGET=' + target) cmake.append('-DDESKTOP_APP_SPECIAL_TARGET=' + target)
cmake.extend(['-Werror=dev', '-Werror=deprecated', '--warn-uninitialized', '..']) cmake.extend(['-Werror=dev', '-Werror=deprecated', '--warn-uninitialized', '..' if not buildType else '../..'])
command = ' '.join(cmake) command = ' '.join(cmake)
if not os.path.exists(basePath): if not os.path.exists(basePath):
os.mkdir(basePath) os.makedirs(basePath)
elif 'force' in arguments: elif 'force' in arguments:
paths = os.listdir(basePath) paths = os.listdir(basePath)
for path in paths: for path in paths: