Skip to content

Commit 4d66759

Browse files
committed
[Project] Upgrade project. Fix almost every issue. Almost a rewrite
1 parent 77a429d commit 4d66759

File tree

166 files changed

+9212
-9019
lines changed

Some content is hidden

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

166 files changed

+9212
-9019
lines changed

.github/workflows/c-cpp.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,22 @@ on:
77
branches: [ master ]
88

99
jobs:
10-
macBuild:
11-
runs-on: macos-12
10+
mac-build:
11+
runs-on: macos-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: make
15-
run: make
16-
17-
linuxBuild:
18-
runs-on: ubuntu-22.04
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: make
22-
run: make
13+
- name: Install Dependencies
14+
run: |
15+
brew update --preinstall
16+
brew install llvm ninja cmake lld
17+
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: 'recursive'
21+
- name: Make
22+
run: |
23+
cmake --preset debug
24+
cmake --preset release
25+
26+
cd build_debug && ninja
27+
cd ../build_release && ninja
28+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
compile_commands.json
1818

1919
build/
20+
build_debug/
21+
build_release/
22+
2023
bin/
2124
obj/
2225
tests/

CMakeLists.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(ktool VERSION 0.1.0 LANGUAGES CXX)
3+
4+
include(CTest)
5+
enable_testing()
6+
7+
file(GLOB_RECURSE SOURCES "src/*.cpp")
8+
add_executable(ktool ${SOURCES})
9+
10+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
11+
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
12+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
13+
14+
include(CPack)
15+
16+
target_include_directories(ktool PUBLIC include)
17+
set_target_properties (ktool PROPERTIES
18+
CXX_STANDARD 23
19+
CXX_STANDARD_REQUIRED TRUE
20+
CXX_EXTENSIONS TRUE
21+
)
22+
23+
target_compile_options(ktool PUBLIC -stdlib=libc++ -Iinclude -Wall -Wextra)
24+
25+
target_link_options(ktool PUBLIC -stdlib=libc++)
26+
target_link_options(ktool PUBLIC -fuse-ld=lld)
27+
28+
set(CMAKE_CXX_CLANG_TIDY
29+
clang-tidy;
30+
-header-filter=include;
31+
-checks=*;)
32+
33+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
34+
target_compile_options(ktool PRIVATE
35+
"-fsanitize=address" "-fsanitize=undefined")
36+
target_link_options(ktool PRIVATE
37+
"-fsanitize=address" "-fsanitize=undefined")
38+
endif()
39+
40+
install_files(. FILES compile_commands.json)
41+
install(TARGETS ktool DESTINATION ${CMAKE_INSTALL_PREFIX})

CMakePresets.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"version": 2,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 5,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "base",
11+
"generator": "Ninja",
12+
"binaryDir": "${sourceDir}/build",
13+
"environment": {
14+
"CXX_FLAGS": "-Wall -Wextra -pedantic -Wall -Wextra -fms-extensions -pedantic -Wredundant-decls -Wstrict-overflow=5 -Wundef -Wnull-dereference -funsigned-char -fno-exceptions -Wno-gnu-case-range -Wno-sign-conversion -Wno-unused-parameter -Wno-gnu-anonymous-struct -Wno-nested-anon-types"
15+
}
16+
},
17+
{
18+
"name": "debug",
19+
"displayName": "Debug",
20+
"binaryDir": "${sourceDir}/build_debug",
21+
"generator": "Ninja",
22+
"cacheVariables": {
23+
"CMAKE_BUILD_TYPE": "Debug",
24+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
25+
"CMAKE_CXX_FLAGS_INIT": "$env{CXX_FLAGS}"
26+
},
27+
"inherits": ["base"]
28+
},
29+
{
30+
"name": "release",
31+
"displayName": "Release",
32+
"binaryDir": "${sourceDir}/build_release",
33+
"generator": "Ninja",
34+
"cacheVariables": {
35+
"CMAKE_BUILD_TYPE": "Release",
36+
"CMAKE_CXX_FLAGS_INIT": "$env{CXX_FLAGS} -O3 -Wno-unused-parameter -Wunused-variable"
37+
},
38+
"inherits": ["base"]
39+
}
40+
]
41+
}

Makefile

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

0 commit comments

Comments
 (0)