mirror of https://github.com/tp4a/teleport
修正无法在win平台构建助手的问题。
parent
47c2fdcff4
commit
9abde183f9
|
@ -320,11 +320,12 @@ def qt_build(prj_path, prj_name, bit_path, target_path):
|
|||
|
||||
if env.is_win:
|
||||
tmp_path = os.path.join(env.root_path, 'out', '_tmp_', prj_name, bit_path)
|
||||
makedirs(tmp_path)
|
||||
# C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.12.0\5.12.0\msvc2017\bin\qtenv2.bat
|
||||
cmd = 'C:\\Windows\\System32\\cmd.exe /A /Q /C ""{}\\qt-helper.bat" "{}\\bin\\qtenv2.bat" "{}VC\\Auxiliary\\Build\\vcvarsall.bat" {} "{}" "{}" {}"'.format(env.build_path, env.qt, env.visual_studio_path, bit_path, tmp_path, prj_path, target_path)
|
||||
ret, _ = sys_exec(cmd)
|
||||
if ret != 0:
|
||||
raise RuntimeError('build XCode project `{}` failed.'.format(prj_name))
|
||||
raise RuntimeError('build Qt project `{}` failed.'.format(prj_name))
|
||||
elif env.is_macos:
|
||||
qmake = os.path.join(env.qt, 'qmake')
|
||||
pro_file = prj_name + '.pro'
|
||||
|
|
|
@ -16,6 +16,6 @@ echo %target%
|
|||
call %qtenv%
|
||||
call %vcvarsall% %bits%
|
||||
|
||||
cd %tmp_path%
|
||||
cd /D %tmp_path%
|
||||
qmake %prj_path%
|
||||
nmake %target%
|
||||
|
|
|
@ -147,17 +147,25 @@ public:
|
|||
|
||||
~ExEvent()
|
||||
{
|
||||
#ifdef EX_OS_WIN32
|
||||
#else
|
||||
pthread_mutex_destroy(&m_mutex);
|
||||
pthread_cond_destroy(&m_cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wait()
|
||||
{
|
||||
#ifdef EX_OS_WIN32
|
||||
#else
|
||||
pthread_cond_wait(&m_cond, &m_mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wait_timeout_ms(int timeout_ms)
|
||||
{
|
||||
#ifdef EX_OS_WIN32
|
||||
#else
|
||||
// timeval.tv_usec ==== ms
|
||||
// timespec.tv_nsec === nano-second
|
||||
struct timeval now = { 0 };
|
||||
|
@ -169,11 +177,15 @@ public:
|
|||
out_time.tv_nsec = (long)((abs_time_ms % 1000ll) * 1000ll);
|
||||
|
||||
pthread_cond_timedwait(&m_cond, &m_mutex, &out_time);
|
||||
#endif
|
||||
}
|
||||
|
||||
void signal()
|
||||
{
|
||||
#ifdef EX_OS_WIN32
|
||||
#else
|
||||
pthread_cond_signal(&m_cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -501,6 +501,7 @@ bool ExLogger::write_a(const char* buf) {
|
|||
return false;
|
||||
|
||||
#ifdef EX_OS_WIN32
|
||||
DWORD dwWritten = 0;
|
||||
WriteFile(m_file, buf, len, &dwWritten, nullptr);
|
||||
m_filesize += len;
|
||||
FlushFileBuffers(m_file);
|
||||
|
|
|
@ -22,7 +22,12 @@ void *ExThreadBase::_thread_func(void *pParam)
|
|||
|
||||
_this->_on_stopped();
|
||||
EXLOGV("[thread] - `%s` exit.\n", _this->m_thread_name.c_str());
|
||||
|
||||
#ifdef EX_OS_WIN32
|
||||
return 0;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
ExThreadBase::ExThreadBase(const char *thread_name) :
|
||||
|
|
Loading…
Reference in New Issue