-
Notifications
You must be signed in to change notification settings - Fork 914
[build] + [core] compilation of SRT on platforms that do not support the pthread_condattr_setclock function. #3152
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
Conversation
maxsharabayko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the formatting comment LGTM. 👍
CMakeLists.txt
Outdated
| message(STATUS "Pthread library: ${PTHREAD_LIBRARY}") | ||
| endif() | ||
|
|
||
| # To avoid the need for other judgments when ENABLE_STDCXX_SYNC is OFF in the future, this is a separate conditional statement. | ||
| if (NOT ENABLE_STDCXX_SYNC AND ENABLE_MONOTONIC_CLOCK) | ||
| list(PREPEND CMAKE_REQUIRED_LIBRARIES "${PTHREAD_LIBRARY}") | ||
| check_symbol_exists(pthread_condattr_setclock "pthread.h" HAVE_PTHREAD_CONDATTR_SETCLOCK) | ||
| if (HAVE_PTHREAD_CONDATTR_SETCLOCK) | ||
| add_definitions(-DHAVE_PTHREAD_CONDATTR_SETCLOCK=1) | ||
| else () | ||
| message(WARNING, "Can't find pthread_condattr_setclock. Try -DENABLE_STDCXX_SYNC=ON or -DENABLE_MONOTONIC_CLOCK=OFF; the latter is not recommended though.") | ||
| endif () | ||
| endif () | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent using tabs, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add_definitions(-DHAVE_PTHREAD_CONDATTR_SETCLOCK=0) otherwise? Not necessary though. Just a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary. If this function doesn't exist, monotonic clock should be simply off, as it's not usable, and SRT with this enforced won't be simply usable at all.
|
Travis PowerPC jobs seems to be failing on the google tests's cmake configure stage. 🤔 |
|
This is idiotic. No indication of an error at all. Maybe add to .travis.yml some thing like |
This pull request proposes an alternative to PR #3138 and #3149, both of which address the compilation of SRT on platforms that do not support the
pthread_condattr_setclockfunction. To achieve this, we introduced a new compilation flag,HAVE_PTHREAD_CONDATTR_SETCLOCK, which is separate fromENABLE_MONOTONIC_CLOCK. Additionally, we moved the function availability check to occur after determining the thread library.