-
Notifications
You must be signed in to change notification settings - Fork 861
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
Android build for dev #326
Conversation
else() | ||
message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.") | ||
endif() | ||
message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.") |
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.
Please restore this code that relies on set CMAKE_PREFIX_PATH, it was here for a reason (crosscompiler on ARM), and your solution doesn't seem to use this path.
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.
I think your hack will break Android.. I pushed a slightly updated version that uses set(PTHREAD_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
I hate cmake
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.
Welcome to the club - although all others are either much worse or at an early development stage. :).
Your fix seems to be ok, the build on ARM cross is ok, can even compile "testing" stuff.
CMakeLists.txt
Outdated
else () | ||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
set(PTHREAD_LIBRARY Threads::Threads) |
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.
Your solution causes a build break on ARM crosscompiler:
/opt/Xilinx/arm-xilinx-linux-gnueabi/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/../../../../arm-xilinx-linux-gnueabi/bin/ld: cannot find -lThreads::Threads
Therefore please restore the part dependent on CMAKE_PREFIX_PATH, you don't use it anyway, and it was proven to work on crosscompiler for ARM.
Instead of trying to force the user to set it, just use the standard function. On non-mingw Windows, keep the same logic that was there.
On Android, there is no sys/syslog, only the in the parent dir. POSIX also only defines <syslog.h>
* dev: (21 commits) Fix SRT file transmit app to work in non-blocking mode (Haivision#334) Ensure stdout silence in console pipe out mode plus a few minor fixups (Haivision#275) Replaced hardcoded installdirs with GNUInstallDirs. Fixed some status messages. (Haivision#323) Breaking connection when recv buffer inflation caused sequence discrepancy (Haivision#300) Fixed problems with encryption decision and status report on encryption failure. (Haivision#318) Fixed invalid symbol names in doc (Haivision#311) Dev add version to winpackages (Haivision#328) Android build for dev (Haivision#326) Change License to MPLv2.0 (Haivision#327) Used constants for input rate. Fixed after-start rate sampling period to 1s (Haivision#315) Made SockaddrToString use only numeric string by default (Haivision#312) Ported change in Haivision#307 PR to dev Fixed SockaddrToString to format as 4dotIP if unknown (Haivision#299) Build with debug information for lldb on iOS platform (Haivision#302) Fix for sudden stop sending data on macOS/iOS (Haivision#303) Fix broken build when testing apps enabled (Haivision#296) Removed all code introduced for CBR (Haivision#293) Added API to get instantaneous stats instead of moving averages for a… (Haivision#288) Added toolchain file and build instruction for iOS (Haivision#286) Fix windows build (Haivision#290) ...
So I saw that some work had been done on the dev branch. But the pthread finding code in the CMakeLists was still broken, so I ported the code I made for the other branch onto there. The big different is still to let the cmake code do its job instead of trying to second guess it on Linux. Also it seems that <sys/syslog.h> is not canonical and it doesn't exist on Android.