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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: mystd ci
name: CI

on:
push:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy doxygen to github pages

on:
push:
branches: [ docs ]
workflow_dispatch:

permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Doxygen
run: sudo apt-get install -y doxygen graphviz

- name: Generate Doxygen docs
run: |
mkdir -p docs/output
doxygen docs/Doxyfile

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/html/
destination_dir: .
keep_files: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build
.vscode
docs/doxygen/
docs/sphinx/_build/
51 changes: 20 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
cmake_minimum_required(VERSION 3.14)
project(mystd)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMAND on)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

# Compiler flags
if(CMAKE_BUILD_TYPE STREQUAL Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g0 -O0 -fsanitize=address,undefined -fno-omit-frame-pointer")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address,undefined")
endif()

# Coverage flags
option(ENABLE_COVERAGE "Enable code coverage" OFF)
if(ENABLE_COVERAGE AND CMAKE_BUILD_TYPE STREQUAL Debug)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
else()
message(WARNING "Coverage is only supported with GCC or Clang")
endif()
endif()

cmake_minimum_required(VERSION 3.14)
project(mystd)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -75,6 +44,13 @@ if(NOT Catch2_FOUND)
message(FATAL_ERROR "Catch2 not found")
endif()

find_package(Doxygen REQUIRED)
configure_file(
docs/Doxyfile
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)

include_directories(include)

add_library(mystd INTERFACE)
Expand Down Expand Up @@ -116,3 +92,16 @@ if(ENABLE_COVERAGE)
message(WARNING "lcov or genhtml not found, coverage report generation disabled")
endif()
endif()

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/docs/doxygen/xml/index.xml
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/docs/doxygen
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
DEPENDS ${CMAKE_SOURCE_DIR}/include/mystd/
COMMENT "Generating Doxygen XML..."
)

add_custom_target(docs
DEPENDS ${CMAKE_BINARY_DIR}/docs/doxygen/xml/index.xml
COMMAND ${SPHINX_EXECUTABLE} -M html ${CMAKE_SOURCE_DIR}/docs/sphinx ${CMAKE_BINARY_DIR}/docs/sphinx
)
29 changes: 29 additions & 0 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PROJECT_NAME = "mystd"
PROJECT_NUMBER = "1.0"
PROJECT_BRIEF = "a stl-like library"

OUTPUT_DIRECTORY = docs/
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = YES

INPUT = include/ src/
RECURSIVE = YES
EXCLUDE_PATTERNS = */tests/* */third_party/*

EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_PACKAGE = YES

GENERATE_HTML = YES
HTML_OUTPUT = html

GENERATE_LATEX = NO

HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES

OPTIMIZE_OUTPUT_FOR_C = NO
MARKDOWN_SUPPORT = YES
AUTOLINK_SUPPORT = YES
Loading