Skip to content

Commit

Permalink
fix: enable building without threads (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 6, 2023
1 parent 747b8a0 commit 1dffb4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,17 +468,14 @@ 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
src/utilities.h
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
Expand Down
5 changes: 3 additions & 2 deletions src/googletest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -614,7 +615,7 @@ class Thread {
}
HANDLE handle_;
DWORD th_;
#else
#elif defined(HAVE_PTHREAD)
pthread_t th_;
#endif
};
Expand Down

0 comments on commit 1dffb4e

Please sign in to comment.