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

Android build for dev #326

Merged
merged 2 commits into from
Apr 3, 2018
Merged

Android build for dev #326

merged 2 commits into from
Apr 3, 2018

Conversation

ocrete
Copy link
Contributor

@ocrete ocrete commented Apr 2, 2018

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.

@ocrete ocrete force-pushed the android-ios-dev branch from 6b4c6b2 to af2373b Compare April 2, 2018 15:54
else()
message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.")
endif()
message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.")
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Collaborator

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)
Copy link
Collaborator

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.

ocrete added 2 commits April 3, 2018 09:15
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>
@ocrete ocrete force-pushed the android-ios-dev branch from af2373b to 3a23049 Compare April 3, 2018 13:15
@rndi rndi merged commit a34e761 into Haivision:dev Apr 3, 2018
Gummilion added a commit to Gummilion/srt that referenced this pull request May 10, 2018
* 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)
  ...
@ocrete ocrete deleted the android-ios-dev branch July 16, 2018 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants