ScreenTranslator/share/ci/build.py

27 lines
753 B
Python
Raw Normal View History

2020-03-01 16:30:43 +07:00
import common as c
from config import *
import os
import platform
c.print('>> Building {} on {}'.format(app_name, os_name))
c.add_to_path(os.path.abspath(qt_dir + '/bin'))
os.environ['ST_DEPS_DIR'] = dependencies_dir
if platform.system() == "Windows":
env_cmd = c.get_msvc_env_cmd(bitness=bitness, msvc_version=msvc_version)
c.apply_cmd_env(env_cmd)
c.recreate_dir(build_dir)
os.chdir(build_dir)
c.run('lupdate "{}"'.format(pro_file))
c.run('lrelease "{}"'.format(pro_file))
c.set_make_threaded()
2020-04-03 22:05:33 +07:00
build_type_flag = 'debug' if build_type == 'debug' else 'release'
qmake_flags = os.environ.get('QMAKE_FLAGS','') + ' CONFIG+=' + build_type_flag
c.run('qmake {} "{}"'.format(qmake_flags, pro_file))
2020-03-01 16:30:43 +07:00
make_cmd = c.get_make_cmd()
c.run(make_cmd)