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
4 changes: 4 additions & 0 deletions .github/scripts/msvc-env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@rem From https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-batch
for /f "delims=" %%p in ('vswhere.exe -prerelease -latest -property installationPath') do set vspath=%%p
@rem From https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#developer_command_file_locations
call "%vspath%\VC\Auxiliary\Build\vcvars%1.bat"
12 changes: 7 additions & 5 deletions .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ jobs:
run: |
bash .github/scripts/install_deps.sh windows
- name: Build Windows binaries
shell: cmd
run: |
cmake -S . -B build --preset msvc${{ matrix.bits }} -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
cmake --build build --config Release
call .github\scripts\msvc-env.bat ${{ matrix.bits }}
Comment thread
Rangi42 marked this conversation as resolved.
cmake -B build -G Ninja -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DCMAKE_C_FLAGS="/nologo"
cmake --build build -- -k 0
- name: Package binaries
working-directory: build
run: |
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP -C Release --verbose
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP --verbose
- name: Upload Windows binaries
uses: actions/upload-artifact@v7
with:
Expand All @@ -60,8 +62,8 @@ jobs:
./.github/scripts/install_deps.sh macos lld
- name: Build binaries
run: |
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
cmake --build build
cmake -B build -G Ninja --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
cmake --build build -- -k 0
strip rgb{asm,link,fix,gfx}
env:
LDFLAGS: -fuse-ld=lld # cmake/macos-static.cmake comments explain why we use lld.
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ env:
CMAKE_CONFIG_TYPE: Debug # `cmake --build` now implies `--config Debug`.
# Approximate number of CPU cores in GitHub's runners as of 2026-03-18:
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
CMAKE_BUILD_PARALLEL_LEVEL: 4 # `cmake --build` now implies `--parallel 4`.
CMAKE_INSTALL_PARALLEL_LEVEL: 4 # `cmake --install` now implies `--parallel 4`.
CTEST_PARALLEL_LEVEL: 0 # `ctest` now implies `--parallel 0` (number of logical CPUs).
CTEST_NO_TESTS_ACTION: error # Make CTest fail if it cannot find any tests. (That should never happen.)
CTEST_OUTPUT_ON_FAILURE: ON # CTest reports test program output on failure.
Expand Down Expand Up @@ -63,8 +61,8 @@ jobs:
# Note that since this is specific to our CI environment, the workaround is
# better applied here than in our CMakeLists, where it could affect and break someone else.
run: |
cmake -S . -B build --preset develop -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DTESTS_OS_NAME=${{ matrix.os }}
cmake --build build --verbose
CXX=${{ matrix.cxx }} cmake -B build -G Ninja --preset develop -DCMAKE_FIND_FRAMEWORK=LAST -DTESTS_OS_NAME=${{ matrix.os }}
cmake --build build -- -k 0
sudo cmake --install build --verbose
- name: Package binaries
run: |
Expand Down Expand Up @@ -122,8 +120,8 @@ jobs:
enableCrossOsArchive: true
- name: Build & install
run: |
cmake -S . -B build --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DTESTS_OS_NAME=macos
cmake --build build
cmake -B build -G Ninja --preset macos-static -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DTESTS_OS_NAME=macos
cmake --build build -- -k 0
env:
LDFLAGS: -fuse-ld=lld # cmake/macos-static.cmake comments explain why we use lld.
- name: Package binaries
Expand Down Expand Up @@ -181,14 +179,16 @@ jobs:
key: dep-srcs-${{ hashFiles('cmake/deps.cmake') }}
enableCrossOsArchive: true
- name: Build Windows binaries
shell: cmd
run: | # ASan seems to be broken on Windows, so we disable it.
cmake -S . -B build --preset develop-msvc${{ matrix.bits }} -DSANITIZERS=OFF \
-DTESTS_OS_NAME=${{ matrix.os }} -DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}"
cmake --build build
call .github\scripts\msvc-env.bat ${{ matrix.bits }}
cmake -B build -G Ninja --preset develop -DSANITIZERS=OFF -DTESTS_OS_NAME=${{ matrix.os }} ^
-DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DCMAKE_C_FLAGS="/nologo"
cmake --build build -- -k 0
- name: Package binaries
working-directory: build
run: |
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP -C Debug --verbose
cpack -DCPACK_PACKAGE_FILE_NAME=rgbds-win${{ matrix.bits }} -G ZIP --verbose
- name: Upload Windows binaries
uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
test/fetch-test-deps.sh --get-deps ${{ matrix.os }}
- name: Run tests using CTest
run: |
ctest --test-dir build --schedule-random -C Debug
ctest --test-dir build --schedule-random

windows-mingw-build:
strategy:
Expand All @@ -241,9 +241,9 @@ jobs:
- name: Cross-build Windows binaries
run: | # MinGW does not support `--preset develop` sanitizers ASan or UBSan.
dll_search_dir=$(printf '%s\n' /usr/lib/gcc/*-w64-mingw32/*-win32 | tee -a /dev/stderr)
cmake -B build --preset develop -DSANITIZERS=OFF --toolchain cmake/toolchain-mingw${{ matrix.bits }}.cmake \
cmake -B build -G Ninja --preset develop -DSANITIZERS=OFF --toolchain cmake/toolchain-mingw${{ matrix.bits }}.cmake \
-DFETCHCONTENT_BASE_DIR="${{ env.DEPS_ROOT_DIR }}" -DDLL_SEARCH_DIRS="$dll_search_dir"
cmake --build build
cmake --build build -- -k 0
- name: Package binaries
run: |
cmake --install build --prefix . --verbose --component binaries
Expand Down Expand Up @@ -362,15 +362,15 @@ jobs:
envs: >-
TERM CLICOLOR CLICOLOR_FORCE
CMAKE_COLOR_DIAGNOSTICS CMAKE_CONFIG_TYPE
CMAKE_BUILD_PARALLEL_LEVEL CTEST_PARALLEL_LEVEL
CTEST_PARALLEL_LEVEL
CTEST_NO_TESTS_ACTION CTEST_OUTPUT_ON_FAILURE
GIT_CONFIG_COUNT GIT_CONFIG_KEY_0 GIT_CONFIG_VALUE_0
release: "14.3"
usesh: true
prepare: |
.github/scripts/install_deps.sh freebsd
run: | # Leak detection is not supported on FreeBSD, so disable it.
cmake -S . -B build --preset develop -DTESTS_OS_NAME=freebsd
cmake --build build --verbose
cmake -B build --preset develop -DTESTS_OS_NAME=freebsd
cmake --build build --verbose -- -k -j 4
Comment thread
ISSOtm marked this conversation as resolved.
ASAN_OPTIONS=detect_leaks=0 ctest --test-dir build --schedule-random --label-exclude external
cmake --install build --verbose
16 changes: 8 additions & 8 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
"errors": { "dev": true }
},
{
"name": "develop-msvc32",
"inherits": ["develop", "msvc32"]
"name": "develop-msbuild32",
"inherits": ["develop", "msbuild32"]
},
{
"name": "develop-msvc64",
"inherits": ["develop", "msvc64"]
"name": "develop-msbuild64",
"inherits": ["develop", "msbuild64"]
},

{
"name": "msvc32",
"description": "Flags for building 32-bit executables with MSVC",
"name": "msbuild32",
"description": "Flags for building 32-bit executables with MSBuild",
"architecture": "Win32"
},
{
"name": "msvc64",
"description": "Flags for building 64-bit executables with MSVC",
"name": "msbuild64",
"description": "Flags for building 64-bit executables with MSBuild",
"architecture": "x64"
},

Expand Down
Loading