Example #1
0
def get_qt_repo():
    print("get qt")
    if os.path.exists(".git"):
        # create submodule for git repo
        with utils.cwd(toolchain_path):
            subprocess.call(['git', 'submodule', 'update', '--init', '--recursive'])
        pass
    elif os.path.exists(".hg"):
        with utils.cwd(toolchain_path):
            subprocess.call([r'git', r'clone', r'--progress', qt_repo_address])
        pass
    print("complete")

    pass
Example #2
0
def check_boost_version():
    with utils.cwd(utils.boost_cmake_path):
        print("boost exist, try to update:")
        p = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
                             stdin=subprocess.PIPE,
                             stdout=subprocess.PIPE)
        p.stdin.close()
        current_revision = p.stdout.read().decode("utf-8")
        current_revision = current_revision[:len(current_revision) - 1]

        git = subprocess.Popen([
            'git', 'ls-remote',
            'https://github.com/nvoronetskiy/boost-cmake.git'
        ],
                               stdin=subprocess.PIPE,
                               stdout=subprocess.PIPE)
        git.stdin.close()
        remote_revision = git.stdout.read().decode("utf-8")
        found = remote_revision.find("HEAD")
        remote_revision = remote_revision[:found - 1]

        print('   local head:  {0}'.format(current_revision))
        print('   remove head: {0}'.format(remote_revision))

        return current_revision == remote_revision
    pass
Example #3
0
def get_boost():
    print("get boost")
    if os.path.exists(".git"):
        # create submodule for git repo
        with utils.cwd('.'):
            subprocess.call(
                ['git', 'submodule', 'update', '--init', '--recursive'])
    elif os.path.exists(".hg"):
        # check if boost always exist
        subprocess.call([
            r'git', r'clone', 'https://github.com/nvoronetskiy/boost-cmake.git'
        ])
    print("complete")
    pass
Example #4
0
def run_boost_cmake():
    root_path = Path('../../../../') / boost_cmake_path
    build_path = Path(utils.obj_lib_etc_path
                      ) / utils.platform / utils.sharedtec / boost_cmake_path
    build_path.mkdir(parents=True, exist_ok=True)
    with utils.cwd(build_path):
        cmd = [
            utils.cmake_path,
            '-G',
            'Visual Studio 15 2017 Win64',
            str(root_path)  # source dir
        ]
        logging.info('Run cmake command: %s', str(cmd))
        subprocess.check_call(cmd)
    pass
Example #5
0
def boost_build():
    boost_dir = get_boost_sorce_sub_path()

    if os.path.exists(boost_dir):
        with utils.cwd(boost_dir):
            if not os.path.exists("bjam.exe") and os.path.exists(
                    "bootstrap.bat"):
                # build bootstrap
                vs_console = utils.find_vs()
                bat_file_path = 'build.bat'

                bootstrap = os.getcwd() + '\\bootstrap.bat'
                print(bootstrap)

                bat_file = open(bat_file_path, 'w')
                bat_file.write('@echo off\n')
                bat_file.write('call \"' + vs_console + '\"\n')
                bat_file.write('cd ' + os.getcwd() + '\n')
                bat_file.write('call ' + bootstrap + '\n')
                bat_file.close()

                cmd = 'cmd /C '
                cmd += bat_file_path
                p1 = subprocess.Popen(cmd)
                p1.wait()

            if os.path.exists("bjam.exe"):
                # build boost
                jobs_count = '-j' + str(multiprocessing.cpu_count())
                subprocess.call([
                    r'bjam', r'--stagedir=stage/x64', jobs_count,
                    r'toolset=msvc', r'address-model=64', r'variant=release',
                    r'threading=multi', r'link=static',
                    r'runtime-link=static,shared', r'define=_SECURE_SCL=0',
                    r'define=_HAS_ITERATOR_DEBUGGING=0',
                    r'define=BOOST_TEST_NO_MAIN'
                ])
                subprocess.call([
                    r'bjam', r'--stagedir=stage/x64', jobs_count,
                    r'toolset=msvc', r'address-model=64', r'variant=debug',
                    r'threading=multi', r'link=static',
                    r'runtime-link=static,shared', r'define=BOOST_TEST_NO_MAIN'
                ])
            else:
                print("bjam not found")
    pass