Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
ColumnLimit: 120
SpacesInParentheses: false
SpaceAfterCStyleCast: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
PointerAlignment: Left
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignTrailingComments: false
SortIncludes: false
Cpp11BracedListStyle: false
64 changes: 64 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Checks: >
bugprone-*
,cert-*
,clang-analyzer-*
,misc-*
,performance-*
,readability-*
,cppcoreguidelines-avoid-c-arrays
,cppcoreguidelines-avoid-do-while
,cppcoreguidelines-avoid-goto
,cppcoreguidelines-init-variables
,cppcoreguidelines-macro-usage
,cppcoreguidelines-pro-bounds-array-to-pointer-decay
,cppcoreguidelines-pro-bounds-constant-array-index
,cppcoreguidelines-pro-bounds-pointer-arithmetic
,cppcoreguidelines-pro-type-const-cast
,cppcoreguidelines-pro-type-cstyle-cast
,cppcoreguidelines-pro-type-reinterpret-cast
,cppcoreguidelines-pro-type-static-cast-downcast
,cppcoreguidelines-pro-type-union-access
,cppcoreguidelines-pro-type-vararg
,cppcoreguidelines-slicing
,cppcoreguidelines-special-member-functions
,cppcoreguidelines-virtual-class-destructor
,google-build-namespaces
,google-build-using-namespace
,google-explicit-constructor
,google-readability-braces-around-statements
,google-readability-casting
,google-readability-function-size
,google-readability-namespace-comments
,google-readability-todo
,google-runtime-int
,google-runtime-operator
,llvm-else-after-return
,llvm-header-guard
,llvm-include-order
,llvm-namespace-comment
,llvm-prefer-isa-or-dyn-cast-in-conditionals
,llvm-prefer-register-over-unsigned
,llvm-twine-local
,misc-confusable-identifiers
,misc-const-correctness
,misc-definitions-in-headers
,misc-header-include-cycle
,misc-include-cleaner
,misc-misleading-bidirectional
,misc-misleading-identifier
,misc-misplaced-const
,misc-new-delete-overloads
,misc-no-recursion
,misc-non-copyable-objects
,misc-non-private-member-variables-in-classes
,misc-redundant-expression
,misc-static-assert
,misc-throw-by-value-catch-by-reference
,misc-unconventional-assign-operator
,misc-unused-alias-decls
,misc-unused-parameters
,misc-unused-using-decls
,-modernize-*
,-abseil-*
,-fuchsia-*
,-hicpp-*
22 changes: 22 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CompileFlags:
Add: [
--target=i686-w64-windows-gnu,
--sysroot=/usr/i686-w64-mingw32,
-std=c++98,
-Wall,
-Wno-pragma-pack,
-D_WIN32,
-DTRACING,
-DTRACE_TERMINAL,
-DTRACE_FILE,
-I/usr/lib/gcc/i686-w64-mingw32/13-win32/include/c++,
-I/usr/lib/gcc/i686-w64-mingw32/13-win32/include/c++/i686-w64-mingw32,
-I/usr/i686-w64-mingw32/include,
-I./src,
-I../openje/src,
-I../tracing/src
]

ClangTidy:
Add:
Checks: '*'
3 changes: 3 additions & 0 deletions .cppcheck-suppress
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unusedVariable
missingIncludeSystem
missingInclude
121 changes: 121 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Nightly Windows build

on:
schedule:
# Runs every night at 03:00 UTC; adjust as needed
- cron: "0 3 * * *"
workflow_dispatch: {} # allow manual runs from the UI

permissions:
contents: write # needed to create/update releases & upload assets
packages: read # needed to pull GHCR image

env:
# CHANGE THIS to your GitHub user or org name (the owner of the original repo)
ORIGIN_OWNER: OpenJE

jobs:
build-nightly-linux-container:
if: github.repository_owner == env.ORIGIN_OWNER
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" |
docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Build with nmake (MSVC 2002 via Docker container)
run: |
# If you need a specific makefile:
# nmake /f path\to\your.mak
docker run --rm \
-u 0:0 \
-v "$PWD":/src \
-w /src \
ghcr.io/OpenJE/msvc2002:latest \
nmake

- name: Locate EXE
id: find-exe
run: |
set -e
exe=$(find . -maxdepth 6 -type f -iname '*.exe' | head -n 1)
if [ -z "$exe" ]; then
echo "No EXE found" >&2
exit 1
fi
echo "exe=$exe" >> "$GITHUB_OUTPUT"
echo "Found: $exe"

- name: Create or update 'nightly' release and upload EXE
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: nightly
name: Nightly
body: |
Nightly build (Linux host invoking MSVC 2002 container).
Commit: ${{ github.sha }}
Ref: ${{ github.ref }}
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
artifacts: ${{ steps.find-exe.outputs.exe }}
artifactContentType: application/octet-stream
allowUpdates: true
replacesArtifacts: false
makeLatest: false
prerelease: true

build-nightly-windows-msvc:
if: github.repository_owner != env.ORIGIN_OWNER
runs-on: windows-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86 # or x64

- name: Build with nmake (latest MSVC)
run: |
REM If you use a specific .mak:
REM nmake /f path\to\your.mak
nmake

- name: Locate EXE
id: find-exe
shell: pwsh
run: |
$exe = Get-ChildItem -Path . -Recurse -Filter *.exe | Select-Object -First 1
if (-not $exe) {
Write-Error "No EXE found"
exit 1
}
"exe=$($exe.FullName)" >> $env:GITHUB_OUTPUT
Write-Host "Found: $($exe.FullName)"

- name: Create or update 'nightly' release and upload EXE
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: nightly
name: Nightly
body: |
Nightly build (Windows MSVC).
Commit: ${{ github.sha }}
Ref: ${{ github.ref }}
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
artifacts: ${{ steps.find-exe.outputs.exe }}
artifactContentType: application/octet-stream
allowUpdates: true
replacesArtifacts: false
makeLatest: false
prerelease: true
112 changes: 112 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build Windows binary for release

on:
release:
types: [published] # fires when you publish a GitHub Release
workflow_dispatch: {} # allow manual trigger for testing

permissions:
contents: write # needed to upload release assets
packages: read # needed to pull GHCR image

env:
# CHANGE THIS to your GitHub user or org name (the owner of the original repo)
ORIGIN_OWNER: OpenJE

jobs:
# 1. Linux job that INVOKES the MSVC 2003 container via docker run
build-linux-container:
# Only run:
# - in the original repo (not forks)
if: github.repository_owner == env.ORIGIN_OWNER

runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" |
docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Build with nmake (MSVC 2002 via Docker container)
run: |
# If you use a specific .mak file, change the last argument to e.g.:
# nmake /f path\to\your.mak
docker run --rm \
-u 0:0 \
-v "$PWD":/src \
-w /src \
ghcr.io/OpenJE/msvc2002:latest \
nmake

- name: Locate EXE
id: find-exe
run: |
set -e
exe=$(find . -maxdepth 6 -type f -iname '*.exe' | head -n 1)
if [ -z "$exe" ]; then
echo "No EXE found" >&2
exit 1
fi
echo "exe=$exe" >> "$GITHUB_OUTPUT"
echo "Found: $exe"

- name: Upload EXE to this GitHub Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.find-exe.outputs.exe }}
asset_name: MyProgram-container-${{ github.ref_name }}.exe
asset_content_type: application/octet-stream

# 2. Windows job using latest MSVC on windows-latest, with nmake
build-windows-msvc:
# Run on forks (i.e., not the original repo owner)
if: github.repository_owner != env.ORIGIN_OWNER

runs-on: windows-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

# Set up the Visual C++ build environment (nmake, cl, etc.)
- name: Set up MSVC Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86 # or x64, adjust for your app

- name: Build with nmake (latest MSVC)
run: |
REM If you use a specific .mak file, do:
REM nmake /f path\to\your.mak
nmake

- name: Locate EXE
id: find-exe
shell: pwsh
run: |
$exe = Get-ChildItem -Path . -Recurse -Filter *.exe | Select-Object -First 1
if (-not $exe) {
Write-Error "No EXE found"
exit 1
}
"exe=$($exe.FullName)" >> $env:GITHUB_OUTPUT
Write-Host "Found: $($exe.FullName)"

- name: Upload EXE to this GitHub Release
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.find-exe.outputs.exe }}
asset_name: MyProgram-msvc-${{ github.ref_name }}.exe
asset_content_type: application/octet-stream
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Debug
Release
build/*
obj/*
vc70.pdb
log.txt
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "openje"]
path = openje
url = https://github.com/OpenJE/openje
[submodule "tracing"]
path = tracing
url = https://github.com/OpenJE/tracing
21 changes: 0 additions & 21 deletions .vscode/c_cpp_properties.json

This file was deleted.

Loading