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
50 changes: 50 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
root = true

# Language indent/EOL/charset overlap with .vscode/settings.json.
# Rulers, renderWhitespace, detectIndentation, mergeEditor, and
# language-server settings cannot be expressed here — they stay in
# settings.json.

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

# [bat]
[*.{bat,cmd}]
end_of_line = crlf
indent_size = 4
indent_style = space

# [c]
[*.{c,h}]
indent_size = 4
indent_style = space

# [cmake]
[{CMakeLists.txt,*.cmake}]
indent_size = 4
indent_style = tab

# [json]
[*.json]
indent_size = 2
indent_style = space

# [markdown]
[*.md]
indent_size = 2
indent_style = space

# [shellscript]
[*.{bash,sh,zsh}]
indent_size = 2
indent_style = space

# [yaml]
[*.{yaml,yml}]
indent_size = 2
indent_style = space
129 changes: 119 additions & 10 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,126 @@
# .gitattributes — C / C++ (GitHub-hosted)
#
# Sources: GitHub Docs (line endings), git-scm gitattributes (diff=cpp),
# gitattributes/gitattributes C++.gitattributes + Common.gitattributes,
# github-linguist overrides.
#
# Linguist language-bar policy (Synesis): classify public C API headers as C
# and *.cmake as CMake scripts; keep helper scripts, IDE project files, and
# CMakeLists.txt config out of the advertised language mix. Prefer
# -linguist-detectable over linguist-detectable=false.

# Default: detect text, normalize to LF in the repository
* text=auto

# --- Source ---
*.c text diff=cpp
*.c++ text diff=cpp
*.cc text diff=cpp
*.cpp text diff=cpp
*.cxx text diff=cpp
*.h text diff=cpp
*.h++ text diff=cpp
*.hh text diff=cpp
*.hpp text diff=cpp
*.hxx text diff=cpp
*.inc text
*.inl text
*.ipp text
*.tcc text
*.tpp text

# --- Build / config ---
*.am text
*.cmake text
*.m4 text
*.mak text
*.mk text
*akefile text
CMakeLists.txt text
configure text eol=lf
configure.ac text

# --- Scripts ---
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
*.zsh text eol=lf

# --- Docs / meta ---
*.adoc text
*.markdown text diff=markdown
*.md text diff=markdown
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
LICENSE text
NEWS text
README text
TODO text
.gitattributes text
.gitignore text

# --- Serialisation ---
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# --- Compiled / binary artefacts ---
*.a binary
*.dll binary
*.dylib binary
*.exe binary
*.gch binary
*.la binary
*.lai binary
*.lib binary
*.lo binary
*.o binary
*.obj binary
*.out binary
*.pch binary
*.slo binary
*.so binary

# --- Archives / images (common) ---
*.gif binary
*.gz binary
*.ico binary
*.jpeg binary
*.jpg binary
*.png binary
*.tar binary
*.zip binary

# --- GitHub Linguist ---
**/build/** linguist-generated
**/cmake-build-*/** linguist-generated

# Classification (C-primary / C API with C++ tests; *.cmake as CMake scripts)
*.c linguist-language=C
*.cmake linguist-language=CMake
*.cmd linguist-detectable=false
*.cpp linguist-language=C++
*.cxx linguist-language=C++
*.dsp linguist-detectable=false
*.dsw linguist-detectable=false
*.h linguist-language=C
*.hpp linguist-language=C++
*.html linguist-detectable=false
*.hxx linguist-language=C++
*.sh linguist-detectable=false
*.sln linguist-detectable=false
*.vcxproj linguist-detectable=false
*.vimrc linguist-detectable=false
CMakeLists.txt linguist-language=CMake
makefile linguist-detectable=false

# Keep the bar on library languages (helpers / legacy IDE / docs /
# CMakeLists.txt config; leave *.cmake detectable as CMake)
*.cmd -linguist-detectable
*.dsp -linguist-detectable
*.dsw -linguist-detectable
*.html -linguist-detectable
*.sh -linguist-detectable
*.sln -linguist-detectable
*.vcxproj -linguist-detectable
*.vimrc -linguist-detectable
CMakeLists.txt -linguist-detectable
makefile -linguist-detectable
109 changes: 109 additions & 0 deletions .github/actions/install-sis-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Install Synesis dependencies
description: >-
Clones, builds, and installs the named Synesis Information Systems
dependencies into a single CMake prefix, and exports that prefix both as
the SIS_DEPS environment variable and as the `prefix` output.

inputs:
build-type:
description: CMake build type, for single-configuration generators
required: false
default: Release
c-compiler:
description: C compiler name, or the selector `cl`
required: true
cpp-compiler:
description: C++ compiler name; unused for the `cl` selector
required: true
dependencies:
description: >-
Whitespace-separated synesissoftware repository names, in dependency
order. Each is configured against those already installed, so this
list is deliberately NOT in lexicographic order.
required: true
install-prefix:
description: Directory into which every dependency is installed
required: false
default: ''
toolchain:
description: >-
Toolchain selector, for a toolchain that is not implied by the compiler
names and needs its own generator; presently only `mingw`. Empty
otherwise, in which case the compiler names alone select the toolchain.
required: false
default: ''

outputs:
prefix:
description: Directory into which every dependency was installed
value: ${{ steps.install.outputs.prefix }}

runs:
using: composite

steps:
- id: install
shell: bash
run: |
set -euo pipefail

PREFIX="${{ inputs.install-prefix }}"
[ -n "$PREFIX" ] || PREFIX="${RUNNER_TEMP}/sis-deps"

mkdir -p "$PREFIX"

if [ "${{ inputs.toolchain }}" = "mingw" ]; then
export PATH="/mingw64/bin:$PATH"
fi

for dep in ${{ inputs.dependencies }}; do

echo "::group::Installing $dep"

SRC="${RUNNER_TEMP}/${dep}-src"
BUILD="${RUNNER_TEMP}/${dep}-build"

git clone --depth 1 "https://github.com/synesissoftware/${dep}" "$SRC"

# NOTE: the generator and the build-type/compiler options are the
# *only* things that may differ between these paths; every other
# -D option is passed in all cases, so that no branch can silently
# ignore one.
if [ "${{ inputs.c-compiler }}" = "cl" ]; then
cmake -S "$SRC" -B "$BUILD" \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_PREFIX_PATH="$PREFIX"
cmake --build "$BUILD" --config "${{ inputs.build-type }}" --parallel
cmake --install "$BUILD" --config "${{ inputs.build-type }}"
elif [ "${{ inputs.toolchain }}" = "mingw" ]; then
cmake -S "$SRC" -B "$BUILD" -G "MinGW Makefiles" \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \
-DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_PREFIX_PATH="$PREFIX"
cmake --build "$BUILD" --parallel 2
cmake --install "$BUILD"
else
cmake -S "$SRC" -B "$BUILD" \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE="${{ inputs.build-type }}" \
-DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.cpp-compiler }}" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_PREFIX_PATH="$PREFIX"
cmake --build "$BUILD" --parallel
cmake --install "$BUILD"
fi

echo "::endgroup::"
done

echo "prefix=$PREFIX" >> "$GITHUB_OUTPUT"
echo "SIS_DEPS=$PREFIX" >> "$GITHUB_ENV"
Loading
Loading