mirror of https://github.com/tp4a/teleport
可以在MacOS上编译tp_core和libtpssh了 :)
parent
b43fbc4382
commit
3e2f06a740
|
@ -35,6 +35,7 @@ __pycache__
|
||||||
/out
|
/out
|
||||||
/external/_download_
|
/external/_download_
|
||||||
/external/linux
|
/external/linux
|
||||||
|
/external/macos
|
||||||
/external/jsoncpp
|
/external/jsoncpp
|
||||||
/external/mongoose
|
/external/mongoose
|
||||||
/external/openssl
|
/external/openssl
|
||||||
|
|
|
@ -521,7 +521,7 @@ class BuilderMacOS(BuilderBase):
|
||||||
def _init_path(self):
|
def _init_path(self):
|
||||||
self.PATH_TMP = os.path.join(PATH_EXTERNAL, 'macos', 'tmp')
|
self.PATH_TMP = os.path.join(PATH_EXTERNAL, 'macos', 'tmp')
|
||||||
self.PATH_RELEASE = os.path.join(PATH_EXTERNAL, 'macos', 'release')
|
self.PATH_RELEASE = os.path.join(PATH_EXTERNAL, 'macos', 'release')
|
||||||
self.OPENSSL_PATH_SRC = os.path.join(self.PATH_TMP, 'openssl-{}'.format(env.ver_openssl))
|
self.OPENSSL_PATH_SRC = os.path.join(self.PATH_TMP, 'openssl-OpenSSL_{}'.format(env.ver_openssl.replace('.', '_')))
|
||||||
self.LIBUV_PATH_SRC = os.path.join(self.PATH_TMP, 'libuv-{}'.format(env.ver_libuv))
|
self.LIBUV_PATH_SRC = os.path.join(self.PATH_TMP, 'libuv-{}'.format(env.ver_libuv))
|
||||||
self.MBEDTLS_PATH_SRC = os.path.join(self.PATH_TMP, 'mbedtls-mbedtls-{}'.format(env.ver_mbedtls))
|
self.MBEDTLS_PATH_SRC = os.path.join(self.PATH_TMP, 'mbedtls-mbedtls-{}'.format(env.ver_mbedtls))
|
||||||
self.LIBSSH_PATH_SRC = os.path.join(self.PATH_TMP, 'libssh-{}'.format(env.ver_libssh))
|
self.LIBSSH_PATH_SRC = os.path.join(self.PATH_TMP, 'libssh-{}'.format(env.ver_libssh))
|
||||||
|
@ -552,23 +552,24 @@ class BuilderMacOS(BuilderBase):
|
||||||
cc.w('already exists, skip.')
|
cc.w('already exists, skip.')
|
||||||
|
|
||||||
def _build_openssl(self, file_name):
|
def _build_openssl(self, file_name):
|
||||||
pass # we do not need build openssl anymore, because first time run build.sh we built Python, it include openssl.
|
# we do not need build openssl anymore, because first time run build.sh we built Python, it include openssl.
|
||||||
|
|
||||||
# if not os.path.exists(self.OPENSSL_PATH_SRC):
|
if not os.path.exists(self.OPENSSL_PATH_SRC):
|
||||||
# os.system('tar -zxvf "{}/{}" -C "{}"'.format(PATH_DOWNLOAD, file_name, self.PATH_TMP))
|
os.system('tar -zxvf "{}/{}" -C "{}"'.format(PATH_DOWNLOAD, file_name, self.PATH_TMP))
|
||||||
#
|
|
||||||
# cc.n('build openssl static...')
|
cc.n('build openssl static...')
|
||||||
# if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssl.a')):
|
if os.path.exists(os.path.join(self.PATH_RELEASE, 'lib', 'libssl.a')):
|
||||||
# cc.w('already exists, skip.')
|
cc.w('already exists, skip.')
|
||||||
# return
|
return
|
||||||
#
|
|
||||||
# old_p = os.getcwd()
|
old_p = os.getcwd()
|
||||||
# os.chdir(self.OPENSSL_PATH_SRC)
|
os.chdir(self.OPENSSL_PATH_SRC)
|
||||||
# #os.system('./config --prefix={} --openssldir={}/openssl no-zlib no-shared'.format(self.PATH_RELEASE, self.PATH_RELEASE))
|
#os.system('./config --prefix={} --openssldir={}/openssl no-zlib no-shared'.format(self.PATH_RELEASE, self.PATH_RELEASE))
|
||||||
# os.system('./config --prefix={} --openssldir={}/openssl -fPIC no-zlib no-shared'.format(self.PATH_RELEASE, self.PATH_RELEASE))
|
# os.system('./Configure darwin64-x86_64-cc')
|
||||||
# os.system('make')
|
os.system('./Configure darwin64-x86_64-cc --prefix={} --openssldir={}/openssl -fPIC no-zlib no-shared'.format(self.PATH_RELEASE, self.PATH_RELEASE))
|
||||||
# os.system('make install')
|
os.system('make')
|
||||||
# os.chdir(old_p)
|
os.system('make install')
|
||||||
|
os.chdir(old_p)
|
||||||
|
|
||||||
def _build_libuv(self, file_name):
|
def _build_libuv(self, file_name):
|
||||||
cc.w('build libuv...skip')
|
cc.w('build libuv...skip')
|
||||||
|
@ -735,7 +736,7 @@ class BuilderMacOS(BuilderBase):
|
||||||
' -DWITH_EXAMPLES=OFF' \
|
' -DWITH_EXAMPLES=OFF' \
|
||||||
' -DWITH_BENCHMARKS=OFF' \
|
' -DWITH_BENCHMARKS=OFF' \
|
||||||
' -DWITH_NACL=OFF' \
|
' -DWITH_NACL=OFF' \
|
||||||
' ..'.format(self.PATH_RELEASE, env.ver_openssl_number, self.PATH_RELEASE, self.PATH_RELEASE)
|
''.format(self.PATH_RELEASE, env.ver_openssl_number, self.PATH_RELEASE, self.PATH_RELEASE)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
utils.cmake(build_path, 'Release', False, cmake_define)
|
utils.cmake(build_path, 'Release', False, cmake_define)
|
||||||
|
|
|
@ -87,11 +87,38 @@ class BuilderLinux(BuilderBase):
|
||||||
utils.ensure_file_exists(f)
|
utils.ensure_file_exists(f)
|
||||||
|
|
||||||
|
|
||||||
|
class BuilderMacOS(BuilderBase):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
def build_server(self):
|
||||||
|
cc.n('build server app (tp_core/libtpssh/tp_web)...')
|
||||||
|
|
||||||
|
out_path = os.path.join(env.root_path, 'out', 'server', ctx.bits_path, 'bin')
|
||||||
|
out_files = [os.path.join(out_path, 'tp_core'), os.path.join(out_path, 'libtpssh.so'),
|
||||||
|
os.path.join(out_path, 'tp_web')]
|
||||||
|
|
||||||
|
for f in out_files:
|
||||||
|
if os.path.exists(f):
|
||||||
|
utils.remove(f)
|
||||||
|
|
||||||
|
utils.makedirs(out_path)
|
||||||
|
|
||||||
|
utils.cmake(os.path.join(env.root_path, 'server', 'cmake-build'), ctx.target_path, False)
|
||||||
|
# utils.strip(out_file)
|
||||||
|
|
||||||
|
for f in out_files:
|
||||||
|
if os.path.exists(f):
|
||||||
|
utils.ensure_file_exists(f)
|
||||||
|
|
||||||
|
|
||||||
def gen_builder(dist):
|
def gen_builder(dist):
|
||||||
if dist == 'windows':
|
if dist == 'windows':
|
||||||
builder = BuilderWin()
|
builder = BuilderWin()
|
||||||
elif dist == 'linux':
|
elif dist == 'linux':
|
||||||
builder = BuilderLinux()
|
builder = BuilderLinux()
|
||||||
|
elif dist == 'macos':
|
||||||
|
builder = BuilderMacOS()
|
||||||
else:
|
else:
|
||||||
raise RuntimeError('unsupported platform.')
|
raise RuntimeError('unsupported platform.')
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ CR_LIGHT_MAGENTA = 15 # 亮紫色 - 警告
|
||||||
CR_LIGHT_CYAN = 16 # 亮青色
|
CR_LIGHT_CYAN = 16 # 亮青色
|
||||||
|
|
||||||
CR_VERBOSE = CR_LIGHT_GRAY
|
CR_VERBOSE = CR_LIGHT_GRAY
|
||||||
CR_NORMAL = CR_WHITE
|
CR_NORMAL = CR_RESTORE
|
||||||
CR_INFO = CR_GREEN
|
CR_INFO = CR_GREEN
|
||||||
CR_WARN = CR_LIGHT_YELLOW
|
CR_WARN = CR_LIGHT_YELLOW
|
||||||
CR_ERROR = CR_LIGHT_RED
|
CR_ERROR = CR_LIGHT_RED
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Env(object):
|
||||||
if warn_miss_tool:
|
if warn_miss_tool:
|
||||||
cc.w(' - can not locate `nsis`, so I can not make installer.')
|
cc.w(' - can not locate `nsis`, so I can not make installer.')
|
||||||
|
|
||||||
elif self.is_linux:
|
elif self.is_linux or self.is_macos:
|
||||||
if 'cmake' in _tmp:
|
if 'cmake' in _tmp:
|
||||||
self.cmake = _tmp['cmake']
|
self.cmake = _tmp['cmake']
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -63,9 +63,10 @@ def download_file(desc, url, target_path, file_name):
|
||||||
if env.is_win:
|
if env.is_win:
|
||||||
cmd = '""{}" --no-check-certificate {} -O "{}""'.format(env.wget, url, local_file_name)
|
cmd = '""{}" --no-check-certificate {} -O "{}""'.format(env.wget, url, local_file_name)
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
elif env.is_linux:
|
elif env.is_linux or env.is_macos:
|
||||||
os.system('wget --no-check-certificate {} -O "{}"'.format(url, local_file_name))
|
os.system('wget --no-check-certificate {} -O "{}"'.format(url, local_file_name))
|
||||||
else:
|
else:
|
||||||
|
cc.e('can not download, no download tool.')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not os.path.exists(local_file_name) or not _check_download_file(local_file_name):
|
if not os.path.exists(local_file_name) or not _check_download_file(local_file_name):
|
||||||
|
@ -278,7 +279,7 @@ def sys_exec(cmd, direct_output=False, output_codec=None):
|
||||||
line = line.rstrip('\r\n')
|
line = line.rstrip('\r\n')
|
||||||
|
|
||||||
if direct_output:
|
if direct_output:
|
||||||
cc.o((cc.CR_GRAY, line), end='\n')
|
cc.o((cc.CR_CYAN, line), end='\n')
|
||||||
|
|
||||||
output.append(line)
|
output.append(line)
|
||||||
|
|
||||||
|
@ -334,6 +335,7 @@ def cmake(work_path, target, force_rebuild, cmake_define=''):
|
||||||
else:
|
else:
|
||||||
target = 'Release'
|
target = 'Release'
|
||||||
cmd = '"{}" -DCMAKE_BUILD_TYPE={} {} ..;make'.format(env.cmake, target, cmake_define)
|
cmd = '"{}" -DCMAKE_BUILD_TYPE={} {} ..;make'.format(env.cmake, target, cmake_define)
|
||||||
|
cc.o(cmd)
|
||||||
ret, _ = sys_exec(cmd, direct_output=True)
|
ret, _ = sys_exec(cmd, direct_output=True)
|
||||||
os.chdir(old_p)
|
os.chdir(old_p)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
|
|
|
@ -64,6 +64,9 @@
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef EX_OS_MACOS
|
||||||
|
# include <mach-o/dyld.h> // for _NSGetExecutablePath
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -174,7 +174,7 @@ bool ex_exec_file(ex_wstr& out_filename)
|
||||||
uint32_t length = EX_PATH_MAX;
|
uint32_t length = EX_PATH_MAX;
|
||||||
|
|
||||||
memset(buffer, 0, EX_PATH_MAX);
|
memset(buffer, 0, EX_PATH_MAX);
|
||||||
memset(out_path, 0, EX_PATH_MAX);
|
//memset(out_filename, 0, EX_PATH_MAX);
|
||||||
|
|
||||||
/* Mac OS X has special function to obtain path to executable.
|
/* Mac OS X has special function to obtain path to executable.
|
||||||
* This may return a symlink.
|
* This may return a symlink.
|
||||||
|
@ -182,7 +182,7 @@ bool ex_exec_file(ex_wstr& out_filename)
|
||||||
if (_NSGetExecutablePath(buffer, &length) != 0)
|
if (_NSGetExecutablePath(buffer, &length) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!ex_astr2wstr(out_filename, buffer))
|
if (!ex_astr2wstr(buffer, out_filename))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return ex_abspath(out_filename);
|
return ex_abspath(out_filename);
|
||||||
|
|
|
@ -99,7 +99,7 @@ wchar_t* ex_str2wcs_alloc(const char* in_buffer, int code_page)
|
||||||
#else
|
#else
|
||||||
size_t wlen = 0;
|
size_t wlen = 0;
|
||||||
wlen = mbstowcs(NULL, in_buffer, 0);
|
wlen = mbstowcs(NULL, in_buffer, 0);
|
||||||
if (wlen < 0)
|
if (wlen <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
out_buffer = (wchar_t*)calloc(wlen + 1, sizeof(wchar_t));
|
out_buffer = (wchar_t*)calloc(wlen + 1, sizeof(wchar_t));
|
||||||
|
@ -107,7 +107,7 @@ wchar_t* ex_str2wcs_alloc(const char* in_buffer, int code_page)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wlen = mbstowcs(out_buffer, in_buffer, wlen);
|
wlen = mbstowcs(out_buffer, in_buffer, wlen);
|
||||||
if (wlen < 0)
|
if (wlen <= 0)
|
||||||
{
|
{
|
||||||
free(out_buffer);
|
free(out_buffer);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -152,7 +152,7 @@ char* ex_wcs2str_alloc(const wchar_t* in_buffer, int code_page)
|
||||||
#else
|
#else
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
len = wcstombs(NULL, in_buffer, 0);
|
len = wcstombs(NULL, in_buffer, 0);
|
||||||
if (len < 0)
|
if (len <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
out_buffer = (char*)calloc(len + 1, sizeof(char));
|
out_buffer = (char*)calloc(len + 1, sizeof(char));
|
||||||
|
@ -160,7 +160,7 @@ char* ex_wcs2str_alloc(const wchar_t* in_buffer, int code_page)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
len = wcstombs(out_buffer, in_buffer, len);
|
len = wcstombs(out_buffer, in_buffer, len);
|
||||||
if (len < 0)
|
if (len <= 0)
|
||||||
{
|
{
|
||||||
free(out_buffer);
|
free(out_buffer);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -236,6 +236,6 @@ ex_u64 ex_get_thread_id(void)
|
||||||
#ifdef EX_OS_WIN32
|
#ifdef EX_OS_WIN32
|
||||||
return GetCurrentThreadId();
|
return GetCurrentThreadId();
|
||||||
#else
|
#else
|
||||||
return pthread_self();
|
return (ex_u64)pthread_self();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,7 @@ EX_BOOL ex_localtime_now(int* t, struct tm* dt)
|
||||||
time(&timep);
|
time(&timep);
|
||||||
_tmp = localtime(&timep); //get server's time
|
_tmp = localtime(&timep); //get server's time
|
||||||
if (_tmp == NULL)
|
if (_tmp == NULL)
|
||||||
return NULL;
|
return EX_FALSE;
|
||||||
if(NULL != dt)
|
if(NULL != dt)
|
||||||
memcpy(dt, _tmp, sizeof(struct tm));
|
memcpy(dt, _tmp, sizeof(struct tm));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
#project(teleport)
|
#project(teleport)
|
||||||
|
|
||||||
|
@ -7,8 +9,18 @@ cmake_minimum_required(VERSION 3.5)
|
||||||
#add_executable(teleport ${SOURCE_FILES})
|
#add_executable(teleport ${SOURCE_FILES})
|
||||||
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${teleport_SOURCE_DIR}/../out/server/x64/bin")
|
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${teleport_SOURCE_DIR}/../out/server/x64/bin")
|
||||||
|
|
||||||
add_subdirectory(tp_web/src)
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
MESSAGE(STATUS "build on Linux...")
|
||||||
|
add_subdirectory(tp_web/src)
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
MESSAGE(FATAL_ERROR "unsupported platform: Windows")
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
MESSAGE(STATUS "build on MacOS...")
|
||||||
|
ELSE ()
|
||||||
|
MESSAGE(FATAL_ERROR "unsupported platform: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
||||||
add_subdirectory(tp_core/core)
|
add_subdirectory(tp_core/core)
|
||||||
add_subdirectory(tp_core/protocol/ssh)
|
add_subdirectory(tp_core/protocol/ssh)
|
||||||
add_subdirectory(tp_core/protocol/rdp)
|
#add_subdirectory(tp_core/protocol/rdp)
|
||||||
|
|
||||||
|
|
|
@ -16,24 +16,51 @@ ADD_DEFINITIONS(
|
||||||
-DDISABLE_MD5
|
-DDISABLE_MD5
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-export-dynamic")
|
#set(CMAKE_EXE_LINKER_FLAGS "-export-dynamic")
|
||||||
|
|
||||||
aux_source_directory(. DIR_SRCS)
|
aux_source_directory(. DIR_SRCS)
|
||||||
aux_source_directory(../../../common/libex/src DIR_SRCS)
|
aux_source_directory(../../../common/libex/src DIR_SRCS)
|
||||||
aux_source_directory(../../../external/mongoose DIR_SRCS)
|
aux_source_directory(../../../external/mongoose DIR_SRCS)
|
||||||
aux_source_directory(../../../external/jsoncpp/src/lib_json DIR_SRCS)
|
aux_source_directory(../../../external/jsoncpp/src/lib_json DIR_SRCS)
|
||||||
|
|
||||||
|
|
||||||
#list(REMOVE_ITEM DIR_SRCS "./src/ts_win_service_helper.cpp")
|
#list(REMOVE_ITEM DIR_SRCS "./src/ts_win_service_helper.cpp")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
../../../common/libex/include
|
../../../common/libex/include
|
||||||
|
../../../common/teleport
|
||||||
../../../external/mongoose
|
../../../external/mongoose
|
||||||
../../../external/jsoncpp/include
|
../../../external/jsoncpp/include
|
||||||
../../../external/linux/release/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(../../../external/linux/release/lib)
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-export-dynamic")
|
||||||
|
include_directories(
|
||||||
|
../../../external/linux/release/include
|
||||||
|
)
|
||||||
|
link_directories(../../../external/linux/release/lib)
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
include_directories(
|
||||||
|
../../../external/macos/release/include
|
||||||
|
)
|
||||||
|
link_directories(../../../external/macos/release/lib)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
||||||
|
|
||||||
|
#include_directories(
|
||||||
|
# ../../../common/libex/include
|
||||||
|
# ../../../external/mongoose
|
||||||
|
# ../../../external/jsoncpp/include
|
||||||
|
# ../../../external/linux/release/include
|
||||||
|
#)
|
||||||
|
#link_directories(../../../external/linux/release/lib)
|
||||||
|
|
||||||
add_executable(tp_core ${DIR_SRCS})
|
add_executable(tp_core ${DIR_SRCS})
|
||||||
#target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto sqlite3 dl pthread rt util)
|
#target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto sqlite3 dl pthread rt util)
|
||||||
target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
#target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
target_link_libraries(tp_core ssl crypto mbedx509 mbedtls mbedcrypto dl pthread util)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
|
@ -150,10 +150,14 @@ bool TppManager::load_tpp(const ex_wstr& libname)
|
||||||
ex_wstr filename;
|
ex_wstr filename;
|
||||||
#ifdef EX_OS_WIN32
|
#ifdef EX_OS_WIN32
|
||||||
filename = libname + L".dll";
|
filename = libname + L".dll";
|
||||||
#else
|
#elif defined (EX_OS_LINUX)
|
||||||
filename = L"lib";
|
filename = L"lib";
|
||||||
filename += libname;
|
filename += libname;
|
||||||
filename += L".so";
|
filename += L".so";
|
||||||
|
#elif defined (EX_OS_MACOS)
|
||||||
|
filename = L"lib";
|
||||||
|
filename += libname;
|
||||||
|
filename += L".dylib";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ex_wstr libfile = g_env.m_exec_path;
|
ex_wstr libfile = g_env.m_exec_path;
|
||||||
|
|
|
@ -14,12 +14,36 @@ aux_source_directory(../../../../common/libex/src DIR_SSH_SRCS)
|
||||||
list(REMOVE_ITEM DIR_SSH_SRCS "./dllmain.cpp")
|
list(REMOVE_ITEM DIR_SSH_SRCS "./dllmain.cpp")
|
||||||
list(REMOVE_ITEM DIR_SSH_SRCS "./stdafx.cpp")
|
list(REMOVE_ITEM DIR_SSH_SRCS "./stdafx.cpp")
|
||||||
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
../../../../common/libex/include
|
../../../../common/libex/include
|
||||||
../../../../external/linux/release/include
|
../../../../common/teleport
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(../../../../external/linux/release/lib)
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
include_directories(
|
||||||
|
../../../../external/linux/release/include
|
||||||
|
)
|
||||||
|
link_directories(../../../../external/linux/release/lib)
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
include_directories(
|
||||||
|
../../../../external/macos/release/include
|
||||||
|
)
|
||||||
|
link_directories(../../../../external/macos/release/lib)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
||||||
|
|
||||||
|
#include_directories(
|
||||||
|
# ../../../../common/libex/include
|
||||||
|
# ../../../../external/linux/release/include
|
||||||
|
#)
|
||||||
|
#link_directories(../../../../external/linux/release/lib)
|
||||||
|
|
||||||
add_library(tpssh SHARED ${DIR_SSH_SRCS})
|
add_library(tpssh SHARED ${DIR_SSH_SRCS})
|
||||||
target_link_libraries(tpssh ssh ssh_threads ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
#target_link_libraries(tpssh ssh ssh_threads ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
||||||
|
|
||||||
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
target_link_libraries(tpssh ssh ssh_threads ssl crypto mbedx509 mbedtls mbedcrypto dl pthread rt util)
|
||||||
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
target_link_libraries(tpssh ssh ssh_threads ssl crypto mbedx509 mbedtls mbedcrypto dl pthread util)
|
||||||
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
Loading…
Reference in New Issue