mirror of https://github.com/tp4a/teleport
.调整构建脚本,支持vs2017环境的自动构建。
parent
96fe0a4bca
commit
e96534b4d7
|
@ -29,7 +29,7 @@ class BuilderWin(BuilderBase):
|
||||||
|
|
||||||
def build_exe(self):
|
def build_exe(self):
|
||||||
cc.i('build tp_assist...')
|
cc.i('build tp_assist...')
|
||||||
sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'client', 'tp_assist_win', 'tp_assist.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_assist.exe')
|
out_file = os.path.join(env.root_path, 'out', 'client', ctx.bits_path, ctx.target_path, 'tp_assist.exe')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
|
|
@ -188,7 +188,7 @@ class BuilderWin(BuilderBase):
|
||||||
cc.v('')
|
cc.v('')
|
||||||
|
|
||||||
cc.w('On Windows, when build libssh, need you use cmake-gui.exe to generate solution file')
|
cc.w('On Windows, when build libssh, need you use cmake-gui.exe to generate solution file')
|
||||||
cc.w('for Visual Studio 2015. Visit https://docs.tp4a.com for more details.')
|
cc.w('for Visual Studio 2017. Visit https://docs.tp4a.com for more details.')
|
||||||
cc.w('\nOnce the libssh.sln generated, press Enter to continue or Q to quit...', end='')
|
cc.w('\nOnce the libssh.sln generated, press Enter to continue or Q to quit...', end='')
|
||||||
try:
|
try:
|
||||||
x = env.input()
|
x = env.input()
|
||||||
|
|
|
@ -27,7 +27,7 @@ class BuilderWin(BuilderBase):
|
||||||
if ctx.target_path == 'debug':
|
if ctx.target_path == 'debug':
|
||||||
cc.w('cannot build debug version of tp_web, skip.')
|
cc.w('cannot build debug version of tp_web, skip.')
|
||||||
else:
|
else:
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_web', 'src', 'tp_web.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_web.exe')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_web.exe')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
@ -35,7 +35,7 @@ class BuilderWin(BuilderBase):
|
||||||
utils.ensure_file_exists(out_file)
|
utils.ensure_file_exists(out_file)
|
||||||
|
|
||||||
cc.n('build core server ...')
|
cc.n('build core server ...')
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'core', 'tp_core.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_core.exe')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tp_core.exe')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
@ -43,7 +43,7 @@ class BuilderWin(BuilderBase):
|
||||||
utils.ensure_file_exists(out_file)
|
utils.ensure_file_exists(out_file)
|
||||||
|
|
||||||
cc.n('build SSH protocol ...')
|
cc.n('build SSH protocol ...')
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'ssh', 'tpssh.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tpssh.dll')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tpssh.dll')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
@ -52,7 +52,7 @@ class BuilderWin(BuilderBase):
|
||||||
utils.copy_file(os.path.join(env.root_path, 'external', 'libssh', 'lib', ctx.target_path), os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path), 'ssh.dll')
|
utils.copy_file(os.path.join(env.root_path, 'external', 'libssh', 'lib', ctx.target_path), os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path), 'ssh.dll')
|
||||||
|
|
||||||
cc.n('build TELNET protocol ...')
|
cc.n('build TELNET protocol ...')
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet', 'tptelnet.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'telnet', 'tptelnet.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tptelnet.dll')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tptelnet.dll')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
@ -61,7 +61,7 @@ class BuilderWin(BuilderBase):
|
||||||
|
|
||||||
if with_rdp:
|
if with_rdp:
|
||||||
cc.n('build RDP protocol ...')
|
cc.n('build RDP protocol ...')
|
||||||
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2015.sln')
|
sln_file = os.path.join(env.root_path, 'server', 'tp_core', 'protocol', 'rdp', 'tprdp.vs2017.sln')
|
||||||
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll')
|
out_file = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, ctx.target_path, 'tprdp.dll')
|
||||||
if os.path.exists(out_file):
|
if os.path.exists(out_file):
|
||||||
utils.remove(out_file)
|
utils.remove(out_file)
|
||||||
|
|
|
@ -190,30 +190,41 @@ class Env(object):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _get_msbuild(self):
|
# def _get_msbuild(self):
|
||||||
# 14.0 = VS2015
|
# # 14.0 = VS2015
|
||||||
# 12.0 = VS2012
|
# # 12.0 = VS2012
|
||||||
# 4.0 = VS2008
|
# # 4.0 = VS2008
|
||||||
chk = ['14.0', '12.0', '4.0']
|
# chk = ['14.0', '12.0', '4.0']
|
||||||
|
|
||||||
p = None
|
# p = None
|
||||||
for c in chk:
|
# for c in chk:
|
||||||
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\{}'.format(c), r'MSBuildToolsPath')
|
# p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\{}'.format(c), r'MSBuildToolsPath')
|
||||||
if p is not None:
|
# if p is not None:
|
||||||
break
|
# break
|
||||||
|
|
||||||
return os.path.join(p[0], 'MSBuild.exe') if p is not None else None
|
# return os.path.join(p[0], 'MSBuild.exe') if p is not None else None
|
||||||
|
|
||||||
|
# def _get_visual_studio_path(self):
|
||||||
|
# chk = ['14.0', '12.0', '4.0']
|
||||||
|
# p = None
|
||||||
|
# for c in chk:
|
||||||
|
# p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\VisualStudio\{}'.format(c), r'ShellFolder')
|
||||||
|
# if p is not None:
|
||||||
|
# break
|
||||||
|
|
||||||
|
# return p[0] if p is not None else None
|
||||||
|
|
||||||
def _get_visual_studio_path(self):
|
def _get_visual_studio_path(self):
|
||||||
chk = ['14.0', '12.0', '4.0']
|
|
||||||
p = None
|
p = None
|
||||||
for c in chk:
|
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7', r'15.0')
|
||||||
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\VisualStudio\{}'.format(c), r'ShellFolder')
|
|
||||||
if p is not None:
|
|
||||||
break
|
|
||||||
|
|
||||||
return p[0] if p is not None else None
|
return p[0] if p is not None else None
|
||||||
|
|
||||||
|
def _get_msbuild(self):
|
||||||
|
vs2017 = self._get_visual_studio_path()
|
||||||
|
if vs2017 is None:
|
||||||
|
return None
|
||||||
|
return os.path.join(vs2017, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe')
|
||||||
|
|
||||||
def _get_perl(self):
|
def _get_perl(self):
|
||||||
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\perl', 'BinDir')
|
p = self._winreg_read(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\perl', 'BinDir')
|
||||||
return p[0] if p is not None else None
|
return p[0] if p is not None else None
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>tp_core</RootNamespace>
|
<RootNamespace>tp_core</RootNamespace>
|
||||||
<ProjectName>tp_core</ProjectName>
|
<ProjectName>tp_core</ProjectName>
|
||||||
|
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
@ -34,9 +35,9 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v141_xp</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
|
Loading…
Reference in New Issue