Skip to content

Commit

Permalink
[BUILD:DOCS] Added extra flags option to CMake + Docs updat
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Feb 25, 2025
1 parent e8c6dc0 commit a53f3de
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ if(CMAKE_BUILD_TYPE STREQUAL "Verbose")
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()

# Option to enable mold linker
option(USE_MOLD "Use mold as the linker" OFF)

if(DEFINED USE_MOLD AND USE_MOLD)
message(STATUS "Using mold linker")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=mold -Wl,--stats")
set(CMAKE_LINKER mold)
else()
message(STATUS "Using default linker")
endif()

# Enable diagnostics on compilation and linking
if (COMPILE_REPORT)
message(STATUS "Requested for compile report.")
add_compile_options(-ftime-report)
endif()

set(ENCODER_BIN hls_segmenter)
set(SERVER_BIN hls_server)
set(DISPATCHER_BIN hls_dispatcher)
Expand Down Expand Up @@ -63,12 +80,12 @@ target_link_libraries(${ENCODER_BIN} PRIVATE Boost::log Boost::log_setup Boost::


add_executable(${CLIENT_BIN} ${CLIENT_SRC})
message(STATUS ">> Client compilation with std-C++20...")
message(STATUS "<< Client compilation with std-C++20... >>")
target_compile_features(${CLIENT_BIN} PRIVATE cxx_std_20)
target_link_libraries(${CLIENT_BIN} PRIVATE Boost::log Boost::log_setup Boost::system Boost::thread Boost::filesystem Boost::date_time Boost::regex Threads::Threads OpenSSL::SSL OpenSSL::Crypto ${FFMPEG_LIBRARIES} ${ARCHIVE_LIB} ${ZSTD_LIBRARIES})

add_executable(${SERVER_BIN} ${SERVER_SRC})
message(STATUS ">> Server compilation with std-C++20...")
message(STATUS "<< Server compilation with std-C++20... >>")
target_compile_features(${SERVER_BIN} PRIVATE cxx_std_20)
target_link_libraries(${SERVER_BIN} PRIVATE Boost::log Boost::log_setup Boost::system Boost::thread Boost::filesystem Boost::date_time Boost::regex Threads::Threads OpenSSL::SSL OpenSSL::Crypto ${ARCHIVE_LIB} ${ZSTD_LIBRARIES})

Expand Down Expand Up @@ -109,4 +126,6 @@ message(STATUS "│ Boost Libraries : Boost::log, Boost::system, Boost::
message(STATUS "│ OpenSSL : ${OPENSSL_LIBRARIES}")
message(STATUS "│ ZSTD : ${ZSTD_LIBRARIES}")
message(STATUS "│ Archive Library : ${ARCHIVE_LIB}")
message(STATUS "│ Linker Executable : ${CMAKE_LINKER}")
message(STATUS "│ Linker Flags : ${CMAKE_EXE_LINKER_FLAGS}")
message(STATUS "└──────────────────────────────────────────────────────────\n")
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ TOMLPP_URL := https://raw.githubusercontent.com/marzer/tomlplusplus/refs/heads/m
MINIAUDIO_DEST_DIR := include/
TOMLPP_DEST_DIR := include/toml/

# Allow extra flags for CMake
EXTRA_CMAKE_FLAGS ?=

# Default target: Build everything
default: all

# Parameterized configure function
# Parameterized configure function with optional extra flags
define configure
@mkdir -p $(BUILD_DIR)
@cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_TARGET="$(1)" -DCMAKE_BUILD_TYPE="$(2)" ..
@cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_TARGET="$(1)" -DCMAKE_BUILD_TYPE="$(2)" "$(EXTRA_CMAKE_FLAGS)" ..
endef

# Initialize dependencies
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ make remove # Cleans up all generated transport streams and playlists
make all # Builds all components at once
```

> [!NOTE]
>
> If you want to use any extra flags:
>
> ```bash
> make all EXTRA_FLAGS="-DUSE_MOLD=ON"
> ```
>
> This will try to use [mold](https://github.com/rui314/mold) as the linker for the project.
> You can try different flags but it is recommended that you do not. It is not necessary.
>
## **Architecture**
The **Wavy** system consists of the following components:
Expand Down Expand Up @@ -141,6 +153,12 @@ This makes it so that every owner can index multiple audio files under a clean d
So the capability of the server totally depends on **YOUR** filesystem. This gives you full power to manage your server library to the fullest.
### **Flexibility**
The architecture is designed in a way to make it more flexible in the future.
The server's importance in the overall flow of operations is always kept at a minimum, to ensure that if we were to implement a P2P solution for this someday, the transition and implementation would lead to no heads being bashed into a wall.
### **Generating SSL Certificates**
To generate a **self-signed certificate**, run:
Expand Down

0 comments on commit a53f3de

Please sign in to comment.