Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 617da68

Browse files
authored
Initial commit
0 parents  commit 617da68

23 files changed

+3472
-0
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: milosz275
2+
buy_me_a_coffee: milosz275
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CMake on multiple platforms
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
15+
fail-fast: false
16+
17+
matrix:
18+
os: [ubuntu-latest, windows-latest]
19+
build_type: [Release]
20+
c_compiler: [gcc, clang, cl]
21+
include:
22+
- os: windows-latest
23+
c_compiler: cl
24+
cpp_compiler: cl
25+
- os: ubuntu-latest
26+
c_compiler: gcc
27+
cpp_compiler: g++
28+
- os: ubuntu-latest
29+
c_compiler: clang
30+
cpp_compiler: clang++
31+
exclude:
32+
- os: windows-latest
33+
c_compiler: gcc
34+
- os: windows-latest
35+
c_compiler: clang
36+
- os: ubuntu-latest
37+
c_compiler: cl
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Set reusable strings
43+
44+
id: strings
45+
shell: bash
46+
run: |
47+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
48+
49+
- name: Configure CMake
50+
51+
run: >
52+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
53+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
54+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
55+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
56+
-S ${{ github.workspace }}
57+
58+
- name: Build
59+
60+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
61+
62+
- name: Test
63+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
64+
65+
run: ctest --build-config ${{ matrix.build_type }}

.github/workflows/codeql.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '17 19 * * 6'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
15+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
16+
permissions:
17+
security-events: write
18+
19+
packages: read
20+
21+
actions: read
22+
contents: read
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- language: c-cpp
29+
build-mode: manual
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v3
37+
with:
38+
languages: ${{ matrix.language }}
39+
build-mode: ${{ matrix.build-mode }}
40+
41+
- if: matrix.build-mode == 'manual'
42+
shell: bash
43+
run: |
44+
make
45+
46+
- name: Perform CodeQL Analysis
47+
uses: github/codeql-action/analyze@v3
48+
with:
49+
category: "/language:${{matrix.language}}"

.github/workflows/doxygen-pages.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Doxygen Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install Doxygen
29+
run: sudo apt-get update && sudo apt-get install -y doxygen doxygen-latex doxygen-doc doxygen-gui graphviz xapian-tools
30+
31+
- name: Install doxygen-awesome-css
32+
run: |
33+
git clone https://github.com/jothepro/doxygen-awesome-css.git
34+
cd doxygen-awesome-css
35+
sudo make install
36+
37+
- name: Run Doxygen
38+
run: doxygen
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: 'docs/'
47+
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

.github/workflows/makefile.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Makefile CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install dependencies
18+
run: cd project-name && make

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# Build files
35+
build/
36+
bin/
37+
38+
# CMake
39+
CMakeFiles/
40+
CMakeCache.txt
41+
42+
# Backup
43+
*.bak
44+
45+
# Other
46+
.notes/

.vscode/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cSpell.language": "en,pl",
3+
"cSpell.words": [
4+
"codespaces",
5+
"Doxygen",
6+
"Doxyfile"
7+
],
8+
"editor.formatOnSave": true,
9+
"editor.codeActionsOnSave": {
10+
"source.fixAll.eslint": "always"
11+
},
12+
"editor.formatOnSaveMode": "file",
13+
"editor.formatOnType": true,
14+
"editor.formatOnPaste": true,
15+
"editor.rulers": [
16+
200
17+
],
18+
"editor.tabSize": 4,
19+
"editor.wordWrap": "on",
20+
"editor.wordWrapColumn": 200,
21+
"makefile.configureOnOpen": true,
22+
}

CMakeLists.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
3+
set(PROJECT_NAME Projectname)
4+
project(${PROJECT_NAME} C CXX ASM)
5+
project(PRERELEASE VERSION 0.1.0)
6+
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
7+
set(CMAKE_C_STANDARD 11)
8+
set(CMAKE_CXX_STANDARD 17)
9+
10+
add_executable(${PROJECT_NAME}
11+
project-name/src/main.c
12+
# project-name/src/main.cpp
13+
)
14+
15+
target_link_libraries(${PROJECT_NAME}
16+
PRIVATE
17+
#sfml-graphics
18+
)
19+
20+
target_include_directories(${PROJECT_NAME} PRIVATE
21+
${CMAKE_CURRENT_LIST_DIR}
22+
${CMAKE_CURRENT_LIST_DIR}/project-name/src
23+
${CMAKE_CURRENT_LIST_DIR}/project-name/include
24+
)
25+
26+
# GCC
27+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
28+
add_compile_options(-O2 -g3
29+
-Wall
30+
-Wno-unused-result
31+
-Wno-format
32+
-Wno-unused-function
33+
-Wno-maybe-uninitialized
34+
-Werror
35+
)
36+
endif()
37+
38+
# Clang
39+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
40+
add_compile_options(-O2 -g3
41+
-Wall
42+
-Wno-unused-result
43+
-Wno-format
44+
-Werror
45+
)
46+
endif()
47+
48+
# Microsoft Visual C++
49+
if(MSVC)
50+
add_compile_options(/W4
51+
/WX
52+
)
53+
endif()
54+
55+
add_subdirectory(project-name/src)

0 commit comments

Comments
 (0)