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

Provide sample projects for VS, Xcode... #823

Closed
oviano opened this issue Aug 16, 2019 · 6 comments
Closed

Provide sample projects for VS, Xcode... #823

oviano opened this issue Aug 16, 2019 · 6 comments
Assignees
Labels
[build] Area: Changes in build files Type: Question Questions or things that require clarification

Comments

@oviano
Copy link
Contributor

oviano commented Aug 16, 2019

...when I discovered SRT I found it was quite a steep learning curve to even get a working build. For example, the steps to build for Windows are quite lengthy, install cmake, copy this here, copy that there, download this, check some cmake cache file hasn't incorrectly added something, etc etc. I'd never used cmake on Windows before, so I had to start to figure that out too.

Actually, in the end I hand-build the project myself because it was easier to take a default VS project and drop the right files into it, then make sure the right preprocessor definitions were in place.

I understand that work is currently in progress to make it possible to build and use C++11 mutex, condition variables etc thus optionally removing the pthreads dependency. Similarly, I believe it is now possible to build without SSL, which I didn't need anyway.

This should mean that a simple VS2017/2019 solution could be supplied allowing people to quickly get up to speed with SRT.

Maybe the developers would consider providing such simple projects for VS2017/2019 and Xcode (for macOS, iOS and tvOS) perhaps by making the automated generation of these part of the automated build system.

@maxsharabayko
Copy link
Collaborator

In a certain way having a pre-generated project files is the opposite to the purposes of using CMake.
I totaly agree that the experiance of building SRT on Windows has to be improved.
There are several things happening that might contribute to that improvement.
Support for C++11 is one of them.
One more is to use vcpkg to install pthreads and openssl dependencies. But again, the user will have to install vcpkg, which is not that hard, but still an extra effort.

As an option SRT can be built without encryption at all. With C++11 support this makes it possible to build on Windows without both dependencies (openssl and pthreads).

@oviano
Copy link
Contributor Author

oviano commented Aug 16, 2019

I take your points.

I guess I'm just saying that if you lower the bar a little with some preset projects in addition to the cmake it might make it more accessible to someone who just wants to try it out in their project; the API is so similar to TCP sockets that it was really quite easy to integrate it into my project once I had built the libraries on the various platforms.

But I had to initially persevere in figuring out how to build it on Windows, macOS, iOS and tvOS with the various dependencies and different ways of getting openssl etc for the different platforms, pthreads on Windows etc.

1.4.1 will be great if I can build on modern platforms without any encryption and without needing pthreads on Windows.

@maxsharabayko maxsharabayko added the [build] Area: Changes in build files label Aug 16, 2019
@lewk2
Copy link
Contributor

lewk2 commented Oct 24, 2019

I fell in the same hole at the start of my work with SRT and Windows. I while @maxlovic has a PR in place to improve the Win build instructions, it is still a bit tricky. I have also not tried using VS 2017 or later to compile either.

However, maybe we can draw more attention to the .AppVeyor.yml file for people? This has a completely canned build script for Windows visible (although some software is helpfully preinstalled on the base VM, like VS and cmake). If people want to just consume the library, this actually generates working files - follow the links to the Haivision build on the main readme.md

It is very simple to sign up for a free AppVeyor account yourself too, and then just link your fork to AppVeyor to get building there too.

I have a plan also to pack up the built libraries and push to NuGet.org, which would also make consumption of SRT on Windows trivial - if the goal is using SRT rather than working on the library.

Hope this info is helpful.

@maxsharabayko
Copy link
Collaborator

SRT is going to be included in vcpkg (PR 8712).
Vcpkg is C++ Library Manager for Windows, Linux, and MacOS.
There will be two options to build SRT using vcpkg.

1. Build SRT with vcpkg

Once SRT is added to the list of supported ports of vcpkg, the buld will be:

vcpkg install libsrt

2. Build SRT with openssl and pthreads built with vcpkg

At the moment it can already be used to simplify SRT build.
Vcpkg already has ports for openssl and pthreads, so the build is as easy as

vcpkg install openssl
vcpkg install pthreads

Integrate vcpkg with the build system (CMake will know about packaged installed by vcpkg)

vcpkg integrate install

Then build SRT:

cmake ../ -G "Visual Studio 16 2019" -A x64
             -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake

@maxsharabayko
Copy link
Collaborator

maxsharabayko commented Feb 6, 2020

Thanks to @lelegard for the proposed Windows installer in #1068.
Also SRT is now included in vcpkg, and it can be built easily on Windows.

vcpkg install libsrt

There will be some further improvements in this direction. But we don't see the reason for including sample project files for VS, Xcode, etc.

Plan for C++11 support: #1103.

We have several places to track those efforts. Therefore closing this issue. Thanks for your suggestions and involvement, @oviano!

@maxsharabayko maxsharabayko added the Type: Question Questions or things that require clarification label Feb 6, 2020
@lelegard
Copy link
Contributor

lelegard commented Feb 6, 2020

Thanks to @lelegard for the proposed Windows installer in #876.

In fact, it is #1068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[build] Area: Changes in build files Type: Question Questions or things that require clarification
Projects
None yet
Development

No branches or pull requests

4 participants