From 8f0a63d0239e9e4cc5f1d5ef96b8a9417e6a6a6c Mon Sep 17 00:00:00 2001 From: scribam Date: Fri, 26 Dec 2025 19:25:17 +0100 Subject: [PATCH 1/2] Update GitHub Actions Add Haiku, OmniOS Add MSYS2 --- .github/workflows/cmake.yml | 2 +- .../{bsd.yml => cross-platform-actions.yml} | 29 ++++++++++----- .github/workflows/msys2.yml | 36 +++++++++++++++++++ .github/workflows/switch.yml | 2 +- .github/workflows/vita.yml | 2 +- 5 files changed, 59 insertions(+), 12 deletions(-) rename .github/workflows/{bsd.yml => cross-platform-actions.yml} (52%) create mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 20fbf47..1b09b5b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -10,7 +10,7 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release diff --git a/.github/workflows/bsd.yml b/.github/workflows/cross-platform-actions.yml similarity index 52% rename from .github/workflows/bsd.yml rename to .github/workflows/cross-platform-actions.yml index e31879b..5c8b170 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/cross-platform-actions.yml @@ -1,4 +1,4 @@ -name: BSD +name: BSD, Haiku, OmniOS on: [push, pull_request] @@ -7,23 +7,34 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - operating_system: [ freebsd, netbsd, openbsd ] + operating_system: [ freebsd, haiku, netbsd, omnios, openbsd ] architecture: [ arm64, x86-64 ] include: - operating_system: freebsd - version: '14.2' - pkginstall: sudo pkg update && sudo pkg install -y cmake git ninja pkgconf + version: '15.0' + pkginstall: sudo pkg update && sudo pkg install -y cmake git ninja + - operating_system: haiku + version: 'r1beta5' + pkginstall: pkgman refresh && pkgman install -y cmake git ninja - operating_system: netbsd version: '10.1' - pkginstall: sudo pkgin update && sudo pkgin -y install clang cmake git ninja-build pkgconf + pkginstall: sudo pkgin update && sudo pkgin -y install clang cmake git ninja-build + - operating_system: omnios + version: 'r151056' + pkginstall: sudo pkg refresh && sudo pkg install build-essential cmake git ninja - operating_system: openbsd - version: '7.7' - pkginstall: sudo pkg_add -u && sudo pkg_add cmake git ninja pkgconf + version: '7.8' + pkginstall: sudo pkg_add -u && sudo pkg_add cmake git ninja + exclude: + - operating_system: haiku + architecture: arm64 + - operating_system: omnios + architecture: arm64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: cross-platform-actions/action@v0.28.0 + - uses: cross-platform-actions/action@v0.32.0 with: operating_system: ${{ matrix.operating_system }} architecture: ${{ matrix.architecture }} diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000..31e6399 --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,36 @@ +name: MSYS2 + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - { os: windows-latest, sys: mingw32 } + - { os: windows-latest, sys: mingw64 } + - { os: windows-latest, sys: ucrt64 } + - { os: windows-latest, sys: clang64 } + - { os: windows-11-arm, sys: clangarm64 } + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v6 + + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + update: true + install: make + pacboy: >- + cmake:p + toolchain:p + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release + + - name: Build + run: cmake --build ${{github.workspace}}/build --config Release diff --git a/.github/workflows/switch.yml b/.github/workflows/switch.yml index 8b39616..533e01c 100644 --- a/.github/workflows/switch.yml +++ b/.github/workflows/switch.yml @@ -8,7 +8,7 @@ jobs: container: devkitpro/devkita64:latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/Switch.cmake diff --git a/.github/workflows/vita.yml b/.github/workflows/vita.yml index a240ded..5b02dfb 100644 --- a/.github/workflows/vita.yml +++ b/.github/workflows/vita.yml @@ -8,7 +8,7 @@ jobs: container: vitasdk/vitasdk:latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake From 9922a49a6ca892959adad418afca2ef387ab9ee0 Mon Sep 17 00:00:00 2001 From: scribam Date: Tue, 12 Aug 2025 19:24:57 +0200 Subject: [PATCH 2/2] Check version-script support --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e13345d..fc2aa76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,10 +109,15 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(chdr PRIVATE _CRT_SECURE_NO_WARNINGS) elseif(APPLE) target_link_libraries(chdr PRIVATE -Wl,-dead_strip -Wl,-exported_symbol,_chd_*) - elseif(CMAKE_SYSTEM_NAME STREQUAL OpenBSD) - target_link_libraries(chdr PRIVATE -Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/src/link.T) else() - target_link_libraries(chdr PRIVATE -Wl,--version-script ${CMAKE_CURRENT_SOURCE_DIR}/src/link.T -Wl,--no-undefined) + include(CheckLinkerFlag) + check_linker_flag(C "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/link.T" LINKER_VERSION_SCRIPT_SUPPORTED) + if(LINKER_VERSION_SCRIPT_SUPPORTED) + target_link_options(chdr PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/link.T") + endif() + if(NOT CMAKE_SYSTEM_NAME STREQUAL OpenBSD) + target_link_libraries(chdr PRIVATE -Wl,--no-undefined) + endif() endif() set_target_properties(chdr PROPERTIES C_VISIBILITY_PRESET hidden)