Skip to content

Commit dc7ecc5

Browse files
Merge pull request #17 from FrozenLemonTee/dev
refactor: Add compiler version min require
2 parents f61e8d2 + 8782f52 commit dc7ecc5

82 files changed

Lines changed: 2389 additions & 637 deletions

Some content is hidden

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

.gdbinit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
python
2+
import sys
3+
import os
4+
sys.path.insert(0, os.path.join(os.getcwd(), 'debug'))
5+
import gdbinit
6+
print("GDB pretty-printer for original initialized.")
7+
end

.github/workflows/basic-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: Test Branch CI - Basic Tests
44

55
on:
6-
push:
6+
pull_request:
77
branches: [ test ]
88

99
jobs:

.github/workflows/deploy-docs-existing-tags.yml

Lines changed: 0 additions & 116 deletions
This file was deleted.

.github/workflows/deploy-docs-latest.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ name: Deploy Documentation - Latest
44

55
on:
66
push:
7-
branches: [ master ] # Temporary change from test to master to avoid concurrency push
7+
branches: [ test ]
88

99
jobs:
1010
build-and-deploy:
11+
if: github.repository == 'FrozenLemonTee/original'
1112
runs-on: ubuntu-latest
1213

1314
steps:

.github/workflows/deploy-docs-stable.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ name: Deploy Documentation - Stable
55
on:
66
push:
77
branches: [ master ]
8+
tags:
9+
- 'v*.*.*'
810

911
jobs:
1012
build-and-deploy:
13+
if: github.repository == 'FrozenLemonTee/original'
1114
runs-on: ubuntu-latest
1215

1316
steps:
@@ -45,7 +48,7 @@ jobs:
4548
echo '<body>' >> ../original_docs/docs/html/version.html
4649
echo ' <h1>Documentation Version</h1>' >> ../original_docs/docs/html/version.html
4750
echo ' <p>Version: stable</p>' >> ../original_docs/docs/html/version.html
48-
echo ' <p>Branch: master</p>' >> index.html
51+
echo ' <p>Branch: master</p>' >> ../original_docs/docs/html/version.html
4952
echo " <p>Build Date: $(date -u)</p>" >> ../original_docs/docs/html/version.html
5053
echo " <p>Commit: ${{ github.sha }}</p>" >> ../original_docs/docs/html/version.html
5154
echo '</body>' >> ../original_docs/docs/html/version.html
@@ -64,12 +67,12 @@ jobs:
6467
6568
cd deploy-repo
6669
67-
# Only update stable directory
70+
# Update stable directory
6871
rm -rf stable
6972
mkdir -p stable
7073
cp -r ../../original_docs/docs/html/* stable/
7174
72-
# Create index.html redirection
75+
# Regenerate the main index.html to include the latest tag version
7376
echo '<!DOCTYPE html>' > index.html
7477
echo '<html>' >> index.html
7578
echo '<head>' >> index.html
@@ -82,16 +85,47 @@ jobs:
8285
echo ' <li><a href="stable/index.html">Stable (master branch)</a></li>' >> index.html
8386
echo ' <li><a href="latest/index.html">Latest (test branch)</a></li>' >> index.html
8487
echo ' <li><a href="versions/">Tag versions</a></li>' >> index.html
88+
echo ' </ul>' >> index.html
89+
echo ' <p>Recent tag versions:</p>' >> index.html
90+
echo ' <ul>' >> index.html
91+
92+
# Regenerate the list of recent tag versions (last 5)
93+
for dir in $(ls -1 versions/ 2>/dev/null | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r | head -5); do
94+
echo " <li><a href=\"versions/$dir/index.html\">Version $dir</a></li>" >> index.html
95+
done
96+
8597
echo ' </ul>' >> index.html
8698
echo '</body>' >> index.html
8799
echo '</html>' >> index.html
88100
101+
# Also update versions/index.html to ensure that the list of all versions is up to date
102+
echo '<!DOCTYPE html>' > versions/index.html
103+
echo '<html>' >> versions/index.html
104+
echo '<head>' >> versions/index.html
105+
echo ' <title>Versioned Documentation</title>' >> versions/index.html
106+
echo '</head>' >> versions/index.html
107+
echo '<body>' >> versions/index.html
108+
echo ' <h1>Versioned Documentation</h1>' >> versions/index.html
109+
echo ' <p>Select a version:</p>' >> versions/index.html
110+
echo ' <ul>' >> versions/index.html
111+
112+
# List all versions (from newest to oldest)
113+
for dir in $(ls -1 versions/ 2>/dev/null | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r); do
114+
echo " <li><a href=\"$dir/index.html\">Version $dir</a></li>" >> versions/index.html
115+
done
116+
117+
echo ' </ul>' >> versions/index.html
118+
echo ' <p><a href="../stable/index.html">Stable (master branch)</a></p>' >> versions/index.html
119+
echo ' <p><a href="../latest/index.html">Latest (test branch)</a></p>' >> versions/index.html
120+
echo '</body>' >> versions/index.html
121+
echo '</html>' >> versions/index.html
122+
89123
# Submit and push
90124
git add .
91125
if git diff-index --quiet HEAD --; then
92126
echo "No changes to deploy"
93127
else
94-
git commit -m "Deploy ${{ steps.version.outputs.docs-version }} documentation from ${{ github.sha }}"
128+
git commit -m "Deploy stable documentation from ${{ github.sha }} and update version lists"
95129
git push origin master
96-
echo "✅ Stable documentation deployed successfully"
130+
echo "✅ Stable documentation deployed successfully with updated version lists"
97131
fi

.github/workflows/deploy-docs-tags.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
build-and-deploy:
12+
if: github.repository == 'FrozenLemonTee/original'
1213
runs-on: ubuntu-latest
1314

1415
steps:

.github/workflows/full-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Run tests
5858
run: |
59-
cd build && ctest --output-on-failure
59+
cd build && ctest --verbose --output-on-failure
6060
6161
windows-tests:
6262
runs-on: windows-latest
@@ -75,4 +75,4 @@ jobs:
7575
7676
- name: Run tests
7777
run: |
78-
cd build && ctest -C ${{ matrix.build_type }} --output-on-failure
78+
cd build && ctest --verbose -C ${{ matrix.build_type }} --output-on-failure

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
cmake-build-debug/
2-
.idea/
3-
test.exe
4-
original.zip
5-
original.rar
1+
cmake-build-*/
2+
**/.idea/
63
build/
74
install/
85
.vs/
6+
.vscode/
97
out/
10-
original/
8+
original/
9+
**/__pycache__/
10+
11+
test.exe
12+
original.zip
13+
original.rar

CMakeLists.txt

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
11
# CMakeLists.txt Main
22

33
cmake_minimum_required(VERSION 3.31)
4+
if(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR MATCHES "Ninja Multi-Config")
5+
set(CMAKE_GENERATOR_PLATFORM x64 CACHE STRING "Platform" FORCE)
6+
endif()
47
project(original LANGUAGES CXX)
58
set(ORIGINAL_VERSION 0.1.5)
69
set(CMAKE_CXX_STANDARD 23)
710
set(CMAKE_CXX_STANDARD_REQUIRED True)
11+
set(CMAKE_CXX_EXTENSIONS OFF)
12+
13+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
14+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
15+
message(FATAL_ERROR "GCC version too old. Minimum required: 13.0. Current: ${CMAKE_CXX_COMPILER_VERSION}")
16+
else()
17+
message(STATUS "GCC version: ${CMAKE_CXX_COMPILER_VERSION} (>= 13.0 ✓)")
18+
endif()
19+
endif()
20+
21+
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
22+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20.0)
23+
message(FATAL_ERROR "Clang version too old. Minimum required: 20.0. Current: ${CMAKE_CXX_COMPILER_VERSION}")
24+
else()
25+
message(STATUS "Clang version: ${CMAKE_CXX_COMPILER_VERSION} (>= 20.0 ✓)")
26+
endif()
27+
endif()
28+
if(MSVC)
29+
if(MSVC_VERSION LESS 1944)
30+
message(FATAL_ERROR "MSVC version too old. Minimum required: 14.44.35207 (VS2022 17.10+). Current: ${MSVC_VERSION}")
31+
else()
32+
message(STATUS "MSVC version: ${MSVC_VERSION} (>= 14.44 ✓)")
33+
endif()
34+
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "10.0" CACHE STRING "Windows Target Platform Version")
35+
endif()
36+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
37+
include(CheckCXXCompilerFlag)
38+
check_cxx_compiler_flag("-std=c++23" HAS_CXX23_FLAG)
39+
if(NOT HAS_CXX23_FLAG)
40+
message(WARNING "Compiler may not fully support C++23 standard")
41+
endif()
42+
endif()
43+
844
if (NOT CMAKE_BUILD_TYPE)
9-
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type (default Debug)" FORCE)
45+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (default Release)" FORCE)
1046
endif()
1147

1248
include(CMakePackageConfigHelpers)
@@ -69,24 +105,12 @@ install(FILES
69105
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/original
70106
)
71107

108+
add_subdirectory(debug)
109+
72110
option(BUILD_TESTING "Build the testing directories" ON)
73111

74112
if (BUILD_TESTING)
75113
include(CTest)
76-
if(MSVC)
77-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")
78-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zi")
79-
else()
80-
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
81-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
82-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g")
83-
else()
84-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
85-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
86-
endif()
87-
endif()
88-
89-
# test cases
90-
add_subdirectory(test/other)
91-
add_subdirectory(test/unit_test)
114+
enable_testing()
115+
add_subdirectory(test)
92116
endif ()

0 commit comments

Comments
 (0)