Skip to content

Version and supported archs #234

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

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
# IDEA
.idea
cmake-build-debug
cmake-build-release

# Editor files/directories
/.vscode
Expand All @@ -51,3 +52,4 @@ cmake-build-debug
# Other
.tmp.dprobes.h
libquicr.spdx

18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,24 @@ else()
endif()

project(quicr
VERSION 1.0.0.0
DESCRIPTION "quicr library"
VERSION 1.0.0
DESCRIPTION "QuicR, a Media over QUIC Library"
LANGUAGES CXX)

configure_file( src/version.h.in ${CMAKE_BINARY_DIR}/include/quicr/version.h )
include_directories(${CMAKE_BINARY_DIR}/include )

IF (NOT LINUX AND NOT APPLE)
message(FATAL_ERROR "Unsupported platform, Linux and Apple are the only supported platforms")
endif ()

set (supported_archs arm64 x86_64)
if (NOT ${CMAKE_SYSTEM_PROCESSOR} IN_LIST supported_archs)
message(FATAL_ERROR "Unsupported system architecture '${CMAKE_SYSTEM_PROCESSOR}'. Supported is arm64 and x86_64")
endif()

message(STATUS "Building for ${CMAKE_SYSTEM_PROCESSOR}")

option(LINT "Perform linting with clang-tidy" OFF)
option(QUICR_BUILD_SHARED "Build quicr as a SHARED library" OFF)
option(PLATFORM_ESP_IDF "Enabble support for esp-idf (Default OFF)" OFF)
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ libquicr
An API library that implements publish/subscribe protocol [draft-ietf-moq-transport-04](https://datatracker.ietf.org/doc/html/draft-ietf-moq-transport-04).
The API supports both client and server. Server is intended to be implemented as a relay.

API documentation can be found under https://quicr.github.io/libquicr

## Build

### Dependencies

#### Linux

```
sudo apt-get update && sudo apt-get install -y gcc g++ golang pkgconf cmake make
```

### CMake

Generate the cmake build directory:
Expand Down Expand Up @@ -42,6 +52,12 @@ Use `make cclean` to clean build files.
Server requires a TLS certificate and key file. For development and testing, use a self-signed certificate. Below
are the steps to create a self-signed certificate and private ey.

### Create cert under cmd/examples

```
make cert
```

### OpenSSL/BorningSSL

```
Expand All @@ -59,6 +75,8 @@ openssl req -nodes -x509 -newkey ec:<(openssl ecparam -name prime256v1) -days 36
-keyout server-key.pem -out server-cert.pem
```

OR

```
openssl ecparam -name prime256v1 -genkey -noout -out server-key-ec.pem
openssl req -nodes -x509 -key server-key-ec.pem -days 365 \
Expand Down
11 changes: 9 additions & 2 deletions cmd/examples/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ InitConfig(cxxopts::ParseResult& cli_opts, bool& enable_pub, bool& enable_sub)
spdlog::set_level(spdlog::level::debug);
}

if (cli_opts.count("version") && cli_opts["version"].as<bool>() == true) {
SPDLOG_INFO("QuicR library version: {}", QUICR_VERSION);
exit(0);
}

if (cli_opts.count("pub_namespace") && cli_opts.count("pub_name")) {
enable_pub = true;
SPDLOG_INFO("Publisher enabled using track namespace: {0} name: {1}",
Expand Down Expand Up @@ -267,14 +272,16 @@ main(int argc, char* argv[])
{
int result_code = EXIT_SUCCESS;

cxxopts::Options options("qclient", "MOQ Example Client");
cxxopts::Options options("qclient",
std::string("MOQ Example Client using QuicR Version: ") + std::string(QUICR_VERSION));
options.set_width(75)
.set_tab_expansion()
//.allow_unrecognised_options()
.add_options()("h,help", "Print help")("d,debug", "Enable debugging") // a bool parameter
("v,version", "QuicR Version") // a bool parameter
("r,url", "Relay URL", cxxopts::value<std::string>()->default_value("moq://localhost:1234"))(
"e,endpoint_id", "This client endpoint ID", cxxopts::value<std::string>()->default_value("moq-client"))(
"q,qlog", "Enable qlog using path", cxxopts::value<std::string>()); // end of options
"q,qlog", "Enable qlog using path", cxxopts::value<std::string>());

options.add_options("Publisher")("pub_namespace", "Track namespace", cxxopts::value<std::string>())(
"pub_name", "Track name", cxxopts::value<std::string>())(
Expand Down
9 changes: 8 additions & 1 deletion cmd/examples/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,11 @@ InitConfig(cxxopts::ParseResult& cli_opts)
spdlog::default_logger()->set_level(spdlog::level::debug);
}

if (cli_opts.count("version") && cli_opts["version"].as<bool>() == true) {
SPDLOG_INFO("QuicR library version: {}", QUICR_VERSION);
exit(0);
}

config.endpoint_id = cli_opts["endpoint_id"].as<std::string>();

config.server_bind_ip = cli_opts["bind_ip"].as<std::string>();
Expand All @@ -524,9 +529,11 @@ main(int argc, char* argv[])
{
int result_code = EXIT_SUCCESS;

cxxopts::Options options("qclient", "MOQ Example Client");
cxxopts::Options options("qclient",
std::string("MOQ Example Server using QuicR Version: ") + std::string(QUICR_VERSION));
options.set_width(75).set_tab_expansion().allow_unrecognised_options().add_options()("h,help", "Print help")(
"d,debug", "Enable debugging") // a bool parameter
("v,version", "QuicR Version") // a bool parameter
("b,bind_ip", "Bind IP", cxxopts::value<std::string>()->default_value("127.0.0.1"))(
"p,port", "Listening port", cxxopts::value<uint16_t>()->default_value("1234"))(
"e,endpoint_id", "This relay/server endpoint ID", cxxopts::value<std::string>()->default_value("moq-server"))(
Expand Down
1 change: 1 addition & 0 deletions include/quicr/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#pragma once

#include "quicr/version.h"
#include <quicr/detail/quic_transport.h>
#include <string>

Expand Down
6 changes: 6 additions & 0 deletions src/version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#define QUICR_VERSION "@PROJECT_VERSION@"
#define QUICR_NAME "@PROJECT_NAME@"
#define QUICR_DESCRIPTION "@PROJECT_DESCRIPTION@"