Skip to content
Closed
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
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
linux:
name: linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: System deps
run: |
sudo apt-get update
sudo apt-get install -y ninja-build pkg-config libgl1-mesa-dev \
libboost-all-dev libluajit-5.1-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.*'
modules: 'qtmultimedia'
cache: true
- name: Configure
run: >
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCWB_BUILD_CES_TOOLS=OFF
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure

macos:
name: macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: System deps
# Homebrew Qt: built against the runner's SDK (the aqt binaries still
# reference the AGL framework, removed from modern Xcode SDKs).
run: brew install ninja pkg-config boost luajit qt
- name: Configure
run: >
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCWB_BUILD_CES_TOOLS=OFF
-DCMAKE_PREFIX_PATH="$(brew --prefix qt)"
-DCMAKE_EXE_LINKER_FLAGS="-L$(brew --prefix icu4c)/lib"
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure

windows:
name: windows
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- name: MSYS2 / MinGW64 toolchain + deps
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-pkgconf
mingw-w64-x86_64-boost
mingw-w64-x86_64-luajit
mingw-w64-x86_64-qt6-base
mingw-w64-x86_64-qt6-svg
mingw-w64-x86_64-qt6-multimedia
- name: Configure
run: >
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCWB_BUILD_CES_TOOLS=OFF
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,26 @@ set(LITEHTML_ENABLE_LINT OFF CACHE BOOL "" FORCE)
set(LITEHTML_BUILD_TESTING OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(litehtml)

# Pinned CES: fetch the client engine (ceslib) from the ces remote at a fixed
# commit -- never the local working tree. MakeAvailable also exposes the ces
# server and cesluajitd as build targets, so the local demo runs on the same pin.
# Vendored CES snapshot (vendor/ces): the client engine cwb links. Only ceslib
# and its deps build (EXCLUDE_FROM_ALL); the ces tools are opt-in below. A
# developer can still point at a live checkout with
# -DFETCHCONTENT_SOURCE_DIR_CES=<path> (build.sh CES_SRC).
FetchContent_Declare(ces
GIT_REPOSITORY https://github.com/fcecin/ces
GIT_TAG 1b8bf36)
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/ces
EXCLUDE_FROM_ALL)
set(CES_BUILD_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(ces)

# The local demo loop wants the ces server + cesh on the side; CI does not.
option(CWB_BUILD_CES_TOOLS "Also build the ces server and cesh" ON)
if(CWB_BUILD_CES_TOOLS)
foreach(t ces cesh cesluajitd)
if(TARGET ${t})
set_target_properties(${t} PROPERTIES EXCLUDE_FROM_ALL FALSE)
endif()
endforeach()
endif()

# md4c: a small, fast, MIT-licensed Markdown parser (GFM tables/tasklists). Its
# md4c-html target renders Markdown straight to an HTML fragment that litehtml
# then styles + lays out. Forced static so the app needs no extra runtime .so.
Expand Down
6 changes: 5 additions & 1 deletion src/cesdial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class Dialer {
if (!minx_) return;
if (tickTimer_) {
boost::system::error_code ec;
tickTimer_->cancel(ec);
tickTimer_->cancel();
}
minx_->closeSocket(false);
if (netGuard_) netGuard_->reset();
Expand Down Expand Up @@ -1167,7 +1167,11 @@ uint8_t cesAccountFetch(const std::string& host, uint16_t port,
char when[40] = "";
const std::time_t t = static_cast<std::time_t>(xt);
std::tm tmv{};
#ifdef _WIN32
gmtime_s(&tmv, &t);
#else
gmtime_r(&t, &tmv);
#endif
std::strftime(when, sizeof when, "%Y-%m-%d %H:%M:%S UTC", &tmv);
b << "<tr><th>at</th><td>" << when << "</td></tr>";
}
Expand Down
4 changes: 4 additions & 0 deletions src/widgets/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ QString todayUtc() {
char date[20] = "";
const std::time_t t = std::time(nullptr);
std::tm tmv{};
#ifdef _WIN32
gmtime_s(&tmv, &t);
#else
gmtime_r(&t, &tmv);
#endif
std::strftime(date, sizeof date, "%Y-%m-%d", &tmv);
return QLatin1String(date);
}
Expand Down
Loading
Loading