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
17 changes: 11 additions & 6 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install Dependencies on Linux
run: |
sudo apt update -qq
sudo apt install -y doxygen graphviz postgresql-server-dev-16
sudo apt install -y doxygen graphviz

- name: Install Qt
uses: jurplel/install-qt-action@v4
Expand All @@ -47,15 +47,20 @@ jobs:
- name: Configure project
run: >
cmake -S . -B ./build
-DDOCS_QTDOCSDIR:PATH="${{ runner.workspace }}/Qt/Docs/Qt-6.6.0"
-DASQL_DRIVER_POSTGRES=OFF
-DASQL_DRIVER_MYSQL=OFF
-DASQL_DRIVER_ODBC=OFF
-DASQL_BUILD_DEMOS=OFF
-DBUILD_TESTING=OFF
-DDOCS_QTDOCSDIR="${{ runner.workspace }}/Qt/Docs/Qt-6.6.0"

- name: Create docs
run: cmake --build ./build --target webdocs
run: cmake --build ./build --target docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: build/webdocs/
path: build/docs/html/

# Deployment job, what was uploaded to artifact
deploy:
Expand All @@ -68,4 +73,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
6 changes: 3 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-24.04

config:
- name: clang-tidy
cmake_arg: '-DCMAKE_CXX_CLANG_TIDY=clang-tidy'
cmake_arg: '-DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_CXX_CLANG_TIDY=clang-tidy-18 -DASQL_BUILD_DEMOS=OFF'
qt_version: "6.11.0"

- name: clazy
Expand All @@ -29,7 +29,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt update -qq
sudo apt install -y clazy doxygen graphviz postgresql-server-dev-16 clang-tidy-18 unixodbc-dev libsqlite3-dev
sudo apt install -y clazy clang-18 doxygen graphviz postgresql-server-dev-16 clang-tidy-18 unixodbc-dev libsqlite3-dev libc++-dev libc++abi-dev

- name: Install Qt ${{ matrix.config.qt_version }} with options and default aqtversion
uses: jurplel/install-qt-action@v4
Expand Down
30 changes: 29 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# AppleClang uses libc++ by default; be explicit for consistency.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

Expand Down Expand Up @@ -151,4 +152,31 @@ if (BUILD_TESTING)
add_subdirectory(tests)
endif()

# ── Doxygen docs target ───────────────────────────────────────────────────────
find_package(Doxygen QUIET)
if (Doxygen_FOUND)
set(DOXYGEN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs")

# Optional Qt tag file — can be provided via -DDOCS_QTDOCSDIR=<path>
set(DOXYGEN_QT_TAGFILE "")
if (DEFINED DOCS_QTDOCSDIR)
if (EXISTS "${DOCS_QTDOCSDIR}/qtcore/qtcore.tags")
set(DOXYGEN_QT_TAGFILE "${DOCS_QTDOCSDIR}/qtcore/qtcore.tags")
endif()
endif()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
"${CMAKE_BINARY_DIR}/Doxyfile"
@ONLY
)

add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_BINARY_DIR}/Doxyfile"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
endif()

include(CPackConfig)
39 changes: 39 additions & 0 deletions Doxyfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Doxyfile generated by CMake — edit Doxyfile.in in the source tree.
# SPDX-FileCopyrightText: (C) 2020-2025 Daniel Nicoletti <dantti12@gmail.com>
# SPDX-License-Identifier: MIT

PROJECT_NAME = "ASql"
PROJECT_NUMBER = @PROJECT_VERSION@
PROJECT_BRIEF = "Async SQL library for Qt"

OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIR@

# Input
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src
FILE_PATTERNS = *.h *.hpp
RECURSIVE = NO
EXCLUDE_PATTERNS = *_p.h *Private* ADriver*.h ADriver*.hpp

# Extract everything public
EXTRACT_ALL = YES
EXTRACT_STATIC = YES
HIDE_UNDOC_MEMBERS = NO

# Qt tag file so Doxygen links to Qt docs online
TAGFILES = @DOXYGEN_QT_TAGFILE@=https://doc.qt.io/qt-6/

# HTML output
GENERATE_HTML = YES
HTML_OUTPUT = html
GENERATE_LATEX = NO

# Graphs
HAVE_DOT = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
CLASS_DIAGRAMS = YES

# Misc
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = NO
1 change: 1 addition & 0 deletions src/ADriverOdbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ ADriverOdbc::ADriverOdbc(const QString &connInfo)
m_worker.moveToThread(&m_thread);

connect(&m_worker, &AOdbcThread::queryReady, this, [this] {
Q_ASSERT(this);
QMutexLocker _(&m_worker.m_promisesMutex);
while (!m_worker.m_promisesReady.isEmpty()) {
OdbcQueryPromise promise = m_worker.m_promisesReady.dequeue();
Expand Down
1 change: 1 addition & 0 deletions src/ADriverSqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ADriverSqlite::ADriverSqlite(const QString &connInfo)
m_worker.moveToThread(&m_thread);

connect(&m_worker, &ASqliteThread::queryReady, this, [this] {
Q_ASSERT(this);
QMutexLocker _(&m_worker.m_promisesMutex);
while (!m_worker.m_promisesReady.isEmpty()) {
QueryPromise promise = m_worker.m_promisesReady.dequeue();
Expand Down
1 change: 1 addition & 0 deletions src/adrivermysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ ADriverMysql::ADriverMysql(const QString &connInfo)
m_worker.moveToThread(&m_thread);

connect(&m_worker, &AMysqlThread::queryReady, this, [this] {
Q_ASSERT(this);
QMutexLocker _(&m_worker.m_promisesMutex);
while (!m_worker.m_promisesReady.isEmpty()) {
MysqlQueryPromise promise = m_worker.m_promisesReady.dequeue();
Expand Down
Loading