Skip to content

Commit 76164cd

Browse files
refactor: migrate to modules and support module-based document generation (#1)
* refactor: migrate to modules and support module-based document generation * fix: invalid module units * fix: scan-deps and stop-scache * refactor: move module doc into module folder as index.md * typo: remove common subfix of module name * ci: fasten build process * fix: resolve entry path in lookup function and add test for relative file resolution
1 parent 85a223a commit 76164cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1863
-971
lines changed

.github/workflows/generate-docs.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
generate:
11-
runs-on: windows-2025
11+
runs-on: windows-latest
1212
permissions:
1313
contents: write
1414

@@ -32,8 +32,41 @@ jobs:
3232
restore-keys: |
3333
Windows-sccache-
3434
35+
- name: Restore configure artifacts cache
36+
id: restore-configure-cache
37+
uses: actions/cache/restore@v5
38+
with:
39+
path: |
40+
build/RelWithDebInfo/.llvm
41+
build/RelWithDebInfo/include
42+
build/RelWithDebInfo/_deps
43+
build/RelWithDebInfo/*.tar.*
44+
key: >-
45+
Windows-configure-RelWithDebInfo-${{
46+
hashFiles('pixi.lock', 'pixi.toml', '**/CMakeLists.txt', 'cmake/**/*.cmake')
47+
}}-${{ github.sha }}
48+
restore-keys: |
49+
Windows-configure-RelWithDebInfo-${{ hashFiles('pixi.lock', 'pixi.toml', '**/CMakeLists.txt', 'cmake/**/*.cmake') }}-
50+
51+
- name: Start sccache
52+
run: sccache --start-server
53+
54+
- name: Configure
55+
run: pixi run cmake-config
56+
57+
- name: Save configure artifacts cache
58+
if: success()
59+
uses: actions/cache/save@v5
60+
with:
61+
path: |
62+
build/RelWithDebInfo/.llvm
63+
build/RelWithDebInfo/include
64+
build/RelWithDebInfo/_deps
65+
build/RelWithDebInfo/*.tar.*
66+
key: ${{ steps.restore-configure-cache.outputs.cache-primary-key }}
67+
3568
- name: Build
36-
run: pixi run build
69+
run: pixi run cmake-build
3770

3871
- name: Generate documentation
3972
run: |
@@ -53,7 +86,3 @@ jobs:
5386
name: clore-docs
5487
path: clore-docs.zip
5588
retention-days: 30
56-
57-
- name: Stop sccache
58-
if: always()
59-
run: pixi run -- sccache --stop-server 2>$null

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ endif()
4343
set(CLORE_ENABLE_IPO OFF)
4444
set(CLORE_USE_LTO_ARTIFACT OFF)
4545
if(CLORE_ENABLE_LTO)
46-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
47-
message(STATUS "Interprocedural optimization disabled for Debug builds.")
48-
else()
46+
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
4947
check_ipo_supported(RESULT CLORE_IPO_SUPPORTED OUTPUT CLORE_IPO_ERROR LANGUAGES C CXX)
5048
if(CLORE_IPO_SUPPORTED)
5149
set(CLORE_ENABLE_IPO ON)
@@ -54,6 +52,8 @@ if(CLORE_ENABLE_LTO)
5452
else()
5553
message(WARNING "LTO requested but IPO is not supported by the active toolchain: ${CLORE_IPO_ERROR}")
5654
endif()
55+
else()
56+
message(STATUS "Interprocedural optimization disabled for non-RelWithDebInfo builds.")
5757
endif()
5858
endif()
5959

cmake/toolchain.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ cmake_minimum_required(VERSION 3.30)
33
set(CMAKE_C_COMPILER clang CACHE STRING "")
44
set(CMAKE_CXX_COMPILER clang++ CACHE STRING "")
55

6+
find_program(CLANG_SCAN_DEPS_PATH NAMES "clang-scan-deps" NO_CACHE)
7+
if(CLANG_SCAN_DEPS_PATH)
8+
set(CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS "${CLANG_SCAN_DEPS_PATH}" CACHE FILEPATH "")
9+
else()
10+
unset(CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS CACHE)
11+
endif()
12+
613
find_program(LLVM_AR_PATH "llvm-ar")
714
if(LLVM_AR_PATH)
815
set(CMAKE_AR "${LLVM_AR_PATH}" CACHE FILEPATH "")

pixi.lock

Lines changed: 197 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)