Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v1.17.4 — 2026-01-02

### 🔧 Fixed

- **CMake / Packaging**

- Fixed `find_package(Vix)` failures caused by missing `Boost::filesystem` / `Boost::system` targets.
- Ensured all required dependencies are resolved **before** loading `VixTargets.cmake`.
- Removed deprecated `FindBoost` behavior in exported configs (CMP0167-safe).
- Stabilized consumer builds on macOS (AppleClang + Homebrew Boost) and Linux.

- **Core**

- Removed `Boost::filesystem` from `vix::core` public link interface.
- Restricted Boost dependency to `Boost::system` only (Asio / Beast).
- Updated HTTP server internals and headers accordingly.
- Prevented Boost symbols from leaking into consumer CMake targets.

- **WebSocket**
- Cleaned `vix::websocket` exported link interface.
- Fixed missing `Boost::system` target errors in downstream applications.
- Improved module behavior with modern CMake dependency resolution.

### ✨ Improved

- More robust umbrella CMake configuration for multi-module installs.
- Clearer separation between internal dependencies and public API surface.
- Better cross-platform developer experience when using:
```bash
find_package(Vix CONFIG REQUIRED)
```

## v1.17.3

### Added
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ option(VIX_ENABLE_INSTALL "Enable install/export rules for packaging" ON)

# Compute feature flags as real ON/OFF at configure-time (NO generator expressions)
set(VIX_WITH_JSON ON) # umbrella always links JSON backend
set(VIX_WITH_BOOST_FS ON) # adjust if you ever disable Boost::filesystem in core
set(VIX_WITH_BOOST_FS OFF) # do NOT require Boost for consumers by default
set(VIX_WITH_OPENSSL ON) # adjust if you ever disable SSL in core
set(VIX_WITH_MYSQL OFF) # do NOT require MySQL for consumers by default
set(VIX_WITH_SQLITE OFF) # will be set ON only if websocket exists
Expand Down
84 changes: 30 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,40 +82,6 @@ Results represent steady-state throughput on a simple `"OK"` endpoint.

---

### ✔ Vix.cpp recommended benchmark mode

When benchmarking from inside the Vix.cpp repository (using the built-in example):

```bash
cd ~/vixcpp/vix
export VIX_LOG_LEVEL=critical
export VIX_LOG_ASYNC=false

# Run the optimized example server
vix run example main
```

Then, in another terminal:

```bash
wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/bench
```

If you want CPU pinning for more stable results:

```bash
taskset -c 2 ./build/main
wrk -t8 -c800 -d30s --latency http://127.0.0.1:8080/bench
```

#### 🏁 Result: ~98,942 req/s

✔ Fast-path routing gives +1–3%

Use /fastbench to bypass RequestHandler overhead.

---

# 🧭 Quick Example

```cpp
Expand Down Expand Up @@ -156,7 +122,7 @@ Example startup:
Vix.cpp v1.x (CLI) — Modern C++ backend runtime
[GCC 13.3.0] on linux
Exit: Ctrl+C / Ctrl+D | Clear: Ctrl+L | Type help for help
vix>
>>>
```

---
Expand Down Expand Up @@ -201,18 +167,6 @@ int main()
}
```

## Minimal WebSocket Client

```cpp
auto client = Client::create("localhost", "9090", "/");

client->on_open([] {
std::cout << "Connected!" << std::endl;
});

client->send("chat.message", {"text", "Hello world!"});
```

---

# Why Vix Exists
Expand Down Expand Up @@ -260,19 +214,23 @@ C++20 + Asio + zero-overhead abstractions.

To build **Vix.cpp** from source:

---

## 🐧 Linux / Ubuntu

### Prerequisites

```bash
sudo apt update
sudo apt install -y \
g++-12 cmake make git \ # Build tools
libboost-all-dev \ # Boost (asio, beast)
nlohmann-json3-dev \ # JSON (nlohmann/json)
libspdlog-dev \ # Logging (spdlog)
zlib1g-dev \ # gzip / ZLIB
libmysqlcppconn-dev # Optional: MySQL Connector/C++ for ORM
g++-12 cmake make git \
libboost-all-dev \
nlohmann-json3-dev \
libspdlog-dev \
libfmt-dev \
zlib1g-dev \
libsqlite3-dev \
libmysqlcppconn-dev # Optional: ORM (MySQL)
```

Optional dependencies:
Expand All @@ -290,7 +248,16 @@ sudo apt install -y libmysqlcppconn-dev libsqlite3-dev
Install Homebrew first, then:

```bash
brew install cmake ninja llvm boost nlohmann-json spdlog fmt mysql sqlite3 zlib
brew install cmake ninja boost nlohmann-json spdlog fmt sqlite3 zlib
```

ℹ️ Notes

AppleClang (default on macOS) is fully supported.
llvm is optional and only needed if you explicitly want clang++ from Homebrew.
In rare cases, you may need:

```bash
export ZLIB_ROOT="$(brew --prefix zlib)"
```

Expand All @@ -300,9 +267,18 @@ export ZLIB_ROOT="$(brew --prefix zlib)"
git clone https://github.com/vixcpp/vix.git
cd vix
git submodule update --init --recursive

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

sudo cmake --install build --prefix /usr/local

```

### Verify

```bash
vix --version
```

> This builds the Vix runtime and CLI.
Expand Down
85 changes: 26 additions & 59 deletions cmake/VixConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,23 @@

include(CMakeFindDependencyMacro)

# -------------------------------------------------------
# 0) Optional deps that may be referenced by exported targets
# MUST be defined BEFORE including VixTargets.cmake
# -------------------------------------------------------

find_package(MySQLCppConn QUIET CONFIG)
if (NOT TARGET MySQLCppConn::MySQLCppConn)
add_library(MySQLCppConn::MySQLCppConn INTERFACE IMPORTED)
endif()

# -------------------------------------------------------
# 0bis) Compression deps (optional) — MUST exist before VixTargets.cmake
# -------------------------------------------------------
if (@VIX_WITH_ZLIB@)
find_dependency(ZLIB QUIET)

# Safety net: if ZLIB was found but did not create the target
if (ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB INTERFACE IMPORTED)
target_include_directories(ZLIB::ZLIB INTERFACE "${ZLIB_INCLUDE_DIRS}")
target_link_libraries(ZLIB::ZLIB INTERFACE "${ZLIB_LIBRARIES}")
endif()

# If Vix exports ZLIB::ZLIB, we must have it
if (NOT TARGET ZLIB::ZLIB)
message(FATAL_ERROR
"Vix was built with gzip support (VIX_WITH_ZLIB=ON), but ZLIB::ZLIB is not available on this system."
)
endif()
endif()

# -------------------------------------------------------
# 1) Load exported Vix targets
# -------------------------------------------------------
include("${CMAKE_CURRENT_LIST_DIR}/VixTargets.cmake")

# -------------------------------------------------------
# 2) Core and common dependencies
# -------------------------------------------------------

# ---- deps that exported targets may reference ----
find_dependency(Threads REQUIRED)

find_dependency(fmt CONFIG REQUIRED)

find_dependency(spdlog CONFIG REQUIRED)
if (TARGET spdlog::spdlog AND NOT TARGET spdlog::spdlog_header_only)
add_library(spdlog::spdlog_header_only ALIAS spdlog::spdlog)

if (@VIX_WITH_OPENSSL@)
find_dependency(OpenSSL REQUIRED)
endif()

if (@VIX_WITH_JSON@)
find_dependency(nlohmann_json CONFIG REQUIRED)
endif()

if (@VIX_WITH_BOOST_FS@)
find_dependency(Boost REQUIRED COMPONENTS filesystem system)
endif()

if (@VIX_WITH_OPENSSL@)
find_dependency(OpenSSL REQUIRED)
endif()

# -------------------------------------------------------
# 3) SQLite (optional)
# -------------------------------------------------------
if (@VIX_WITH_SQLITE@)
find_dependency(SQLite3 REQUIRED)

if (TARGET SQLite::SQLite3)
# ok
elseif (TARGET SQLite3::SQLite3)
add_library(SQLite::SQLite3 ALIAS SQLite3::SQLite3)
elseif (TARGET sqlite3)
Expand All @@ -82,9 +30,28 @@ if (@VIX_WITH_SQLITE@)
endif()
endif()

# -------------------------------------------------------
# 4) ORM presence flag (informational)
# -------------------------------------------------------
# Optional (only if referenced by exported targets)
find_package(MySQLCppConn QUIET CONFIG)
if (NOT TARGET MySQLCppConn::MySQLCppConn)
add_library(MySQLCppConn::MySQLCppConn INTERFACE IMPORTED)
endif()

if (@VIX_WITH_ZLIB@)
find_dependency(ZLIB QUIET)
if (ZLIB_FOUND AND NOT TARGET ZLIB::ZLIB)
add_library(ZLIB::ZLIB INTERFACE IMPORTED)
target_include_directories(ZLIB::ZLIB INTERFACE "${ZLIB_INCLUDE_DIRS}")
target_link_libraries(ZLIB::ZLIB INTERFACE "${ZLIB_LIBRARIES}")
endif()
if (NOT TARGET ZLIB::ZLIB)
message(FATAL_ERROR "Vix built with gzip support but ZLIB::ZLIB is unavailable.")
endif()
endif()

# ---- load exported targets ----
include("${CMAKE_CURRENT_LIST_DIR}/VixTargets.cmake")

# ---- informational flags ----
set(VIX_HAS_ORM @VIX_HAS_ORM@)
if (VIX_HAS_ORM AND NOT TARGET vix::orm)
set(VIX_HAS_ORM OFF)
Expand Down
2 changes: 1 addition & 1 deletion modules/core
Loading