Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable building without threads #964

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading