def get_build_tool_by_arch(self, arch): if self.version == "vs2017": if arch.lower().endswith(core.TARGET_CPU_X64): bin_path = "VC/Auxiliary/Build/vcvars64.bat" else: bin_path = "VC/Auxiliary/Build/vcvars32.bat" else: if arch.lower().endswith(core.TARGET_CPU_X64): bin_path = "VC/bin/amd64/vcvars64.bat" else: bin_path = "VC/bin/vcvars32.bat" from core.utils import utils return utils.fix_path_style(os.path.join(self.install_root, bin_path))
def __wrap_vs_info(self, install_folder, version): """ 包装vs信息为对象 :param install_folder: :param version: :return: """ vs_tool_info = VSToolInfo() vs_tool_info.install_root = install_folder vs_tool_info.version = version from core.utils import utils vs_tool_info.ide_tool_path = utils.fix_path_style( os.path.join(install_folder, "Common7/IDE/devenv.exe")) self.__all_vs_tools.append(vs_tool_info)
def __init_work_path(self): """ 通过参数初始化work_path :return: """ self.__work_path = self.get_opt('d', 'directory') # 对相对路径的支持,把相对路径修正为绝对路径 if self.__work_path and not os.path.isabs(self.__work_path): self.__work_path = os.path.abspath(os.path.join(os.getcwd(), self.__work_path)) for i in range(0, len(self.__tmake_argv)): item = self.__tmake_argv[i] if (item == "-d" or item == "--directory") and len(self.__tmake_argv) > i + 1: self.__tmake_argv[i + 1] = self.__work_path break # 如果没设置路径默认为当前路径 if not self.__work_path: self.__work_path = os.getcwd() from core.utils import utils self.__work_path = utils.fix_path_style(self.__work_path)