fix: enable building without threads (#964)
This commit is contained in:
parent
747b8a0774
commit
1dffb4eb29
@ -468,6 +468,7 @@ set (GLOG_SRCS
|
||||
src/demangle.h
|
||||
src/logging.cc
|
||||
src/raw_logging.cc
|
||||
src/signalhandler.cc
|
||||
src/symbolize.cc
|
||||
src/symbolize.h
|
||||
src/utilities.cc
|
||||
@ -475,10 +476,6 @@ set (GLOG_SRCS
|
||||
src/vlog_is_on.cc
|
||||
)
|
||||
|
||||
if (HAVE_PTHREAD OR WIN32 OR CYGWIN)
|
||||
list (APPEND GLOG_SRCS src/signalhandler.cc)
|
||||
endif (HAVE_PTHREAD OR WIN32 OR CYGWIN)
|
||||
|
||||
if (CYGWIN OR WIN32)
|
||||
list (APPEND GLOG_SRCS
|
||||
src/windows/port.cc
|
||||
|
||||
@ -595,7 +595,8 @@ class Thread {
|
||||
void Start() { pthread_create(&th_, nullptr, &Thread::InvokeThread, this); }
|
||||
void Join() { pthread_join(th_, nullptr); }
|
||||
#else
|
||||
# error No thread implementation.
|
||||
void Start() {}
|
||||
void Join() {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
@ -614,7 +615,7 @@ class Thread {
|
||||
}
|
||||
HANDLE handle_;
|
||||
DWORD th_;
|
||||
#else
|
||||
#elif defined(HAVE_PTHREAD)
|
||||
pthread_t th_;
|
||||
#endif
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user