Skip to content

Commit a0ccff8

Browse files
committed
1:1 material read/write
1 parent f4a7298 commit a0ccff8

58 files changed

Lines changed: 3957 additions & 2052 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CMake with Ninja and GitHub Release
2+
3+
on:
4+
push:
5+
tags: [ "v*" ] # Trigger only on version tag pushes (e.g., v1.0.0)
6+
7+
jobs:
8+
build:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, windows-latest]
15+
build_type: [Release]
16+
c_compiler: [gcc, clang, cl]
17+
include:
18+
- os: windows-latest
19+
c_compiler: cl
20+
cpp_compiler: cl
21+
- os: ubuntu-latest
22+
c_compiler: gcc
23+
cpp_compiler: g++
24+
- os: ubuntu-latest
25+
c_compiler: clang
26+
cpp_compiler: clang++
27+
exclude:
28+
- os: windows-latest
29+
c_compiler: gcc
30+
- os: windows-latest
31+
c_compiler: clang
32+
- os: ubuntu-latest
33+
c_compiler: cl
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Install Ninja (Linux only)
40+
if: runner.os == 'Linux'
41+
run: sudo apt-get update && sudo apt-get install -y ninja-build
42+
43+
- name: Set reusable strings
44+
id: strings
45+
shell: bash
46+
run: |
47+
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
48+
echo "artifact-name=release-${{ matrix.os }}-${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT"
49+
50+
- name: Setup MSVC Developer Command Prompt
51+
if: runner.os == 'Windows'
52+
uses: ilammy/msvc-dev-cmd@v1
53+
54+
- name: Configure CMake (Ninja)
55+
run: >
56+
cmake -G Ninja
57+
-B ${{ steps.strings.outputs.build-output-dir }}
58+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
59+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
60+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
61+
-S ${{ github.workspace }}
62+
63+
64+
- name: Build
65+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
66+
67+
- name: Archive Build Artifacts
68+
shell: pwsh
69+
run: |
70+
New-Item -ItemType Directory -Force -Path release
71+
Copy-Item -Path "${{ steps.strings.outputs.build-output-dir }}\*" -Destination release -Recurse
72+
Compress-Archive -Path release\* -DestinationPath "${{ steps.strings.outputs.artifact-name }}.zip"
73+
74+
- name: Upload Artifact to CI
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: ${{ steps.strings.outputs.artifact-name }}
78+
path: ${{ steps.strings.outputs.artifact-name }}.zip
79+
80+
- name: Upload to GitHub Release
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
tag_name: ${{ github.ref_name }}
84+
name: Release ${{ github.ref_name }}
85+
files: ${{ steps.strings.outputs.artifact-name }}.zip
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ FodyWeavers.xsd
369369

370370
*.mod
371371
*.txe
372-
*.ini
373-
material_dump.txt
374-
*.bak
375-
*.dmd
372+
*.txt
373+
!CMakeLists.txt
374+
/build
375+
/.vscode

CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
cmake_minimum_required(VERSION 3.21)
2+
project(modconv LANGUAGES CXX)
3+
4+
set(CMAKE_CXX_STANDARD 20)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
set(CMAKE_CXX_EXTENSIONS OFF)
7+
8+
# Include all source files within src/
9+
file(GLOB_RECURSE SRC_FILES
10+
${PROJECT_SOURCE_DIR}/src/*.cpp
11+
)
12+
13+
# Create the executable
14+
add_executable(modconv ${SRC_FILES})
15+
16+
# Include directories
17+
target_include_directories(modconv PRIVATE
18+
${PROJECT_SOURCE_DIR}/src/common
19+
${PROJECT_SOURCE_DIR}/src/util
20+
${PROJECT_SOURCE_DIR}/src
21+
)
22+
23+
# Compiler warnings
24+
if(MSVC)
25+
target_compile_options(modconv PRIVATE /W4)
26+
else()
27+
target_compile_options(modconv PRIVATE -Wall -Wextra -Wpedantic)
28+
endif()

DMD.cpp

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

DMD.hpp

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

MODConv.sln

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

MODConv.vcxproj

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

0 commit comments

Comments
 (0)