Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add more compilers #208

Merged
merged 16 commits into from
Jan 5, 2025
Merged
41 changes: 26 additions & 15 deletions .github/workflows/generate-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@ on:
- 'spectool/**'

jobs:
build_tools_win32:
name: Build all tools for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
build_tools:
name: Build tools for ${{ matrix.target.name }}
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-latest
triplet: x64-linux
CMAKE_CC: CC=gcc-14
- os: macos-latest
triplet: x64-osx
env:
CMAKE_OPTIONS: -DDEV_MODE=ON
target: [
{"name": "Linux GCC 14", "os": "ubuntu-latest", "cmake_env": "CC=gcc-14"},
{"name": "Linux Clang 18", "os": "ubuntu-latest", "cmake_env": "CC=clang-18"},
{"name": "Linux GCC 7", "os": "ubuntu-20.04", "cmake_env": "CC=gcc-7", "install": "gcc-7"},
{"name": "Linux Clang 7", "os": "ubuntu-20.04", "cmake_env": "CC=clang-7", "install": "clang-7"},
{"name": "macOS arm64", "os": "macos-15", "cmake_env": "CMAKE_OSX_ARCHITECTURES=arm64"},
{"name": "macOS x86_64", "os": "macos-15", "cmake_env": "CMAKE_OSX_ARCHITECTURES=x86_64"},
{"name": "Windows", "os": "windows-latest"},
{"name": "Windows Arm64", "os": "windows-latest", "cmake_options": "-A arm64"},
{"name": "Windows Clang-CL", "os": "windows-latest", "cmake_options": "-T ClangCl"},
{"name": "WinArm64 Clang-CL","os": "windows-latest", "cmake_options": "-T ClangCl -A arm64"},
]
steps:
- name: list compilers
if: ${{ contains(matrix.target.os, 'ubuntu') }}
run: dpkg --list | grep compiler

- name: intall compilers
if: ${{ contains(matrix.target.os, 'ubuntu') && matrix.target.install != '' }}
run: |
sudo add-apt-repository --yes --update ppa:ubuntu-toolchain-r/test
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends ${{ matrix.target.install }}

- name: Get pushed code
uses: actions/checkout@v4

- name: Configure CMake
run: ${{ matrix.CMAKE_CC }} cmake -S . -B _build ${{ env.CMAKE_OPTIONS }}
run: ${{ matrix.target.cmake_env }} cmake -S . -B _build -DDEV_MODE=ON ${{ matrix.target.cmake_options }}

- name: Build with CMake
run: cmake --build _build --config Debug --parallel
Expand Down
6 changes: 3 additions & 3 deletions libmatroska2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ if (CONFIG_ZLIB)

FetchContent_Declare(
zlib
URL "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz"
URL_HASH SHA512=580677aad97093829090d4b605ac81c50327e74a6c2de0b85dd2e8525553f3ddde17556ea46f8f007f89e435493c9a20bc997d1ef1c1c2c23274528e3c46b94f
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
GIT_REPOSITORY https://github.com/madler/zlib.git
GIT_TAG 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf # 1.3.1 tag
PATCH_COMMAND git apply "${CMAKE_CURRENT_SOURCE_DIR}/zlib/0001-CMake-don-t-build-dynamic-zlib.patch"
)

FetchContent_MakeAvailable(zlib)
Expand Down
3 changes: 3 additions & 0 deletions libmatroska2/minilzo/lzodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@
#elif defined(__arm__) || defined(_M_ARM)
# define LZO_ARCH_ARM 1
# define LZO_INFO_ARCH "arm"
#elif defined(_M_ARM64)
//# define LZO_ARCH_ARM 1
# define LZO_INFO_ARCH "arm64"
#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
# define LZO_ARCH_AVR 1
# define LZO_INFO_ARCH "avr"
Expand Down
4 changes: 3 additions & 1 deletion libmatroska2/minilzo/minilzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@
#elif defined(__arm__) || defined(_M_ARM)
# define LZO_ARCH_ARM 1
# define LZO_INFO_ARCH "arm"
#elif defined(_M_ARM64)
//# define LZO_ARCH_ARM 1
# define LZO_INFO_ARCH "arm64"
#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
# define LZO_ARCH_AVR 1
# define LZO_INFO_ARCH "avr"
Expand Down Expand Up @@ -4109,4 +4112,3 @@ DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
#endif

/***** End of minilzo.c *****/

81 changes: 81 additions & 0 deletions libmatroska2/zlib/0001-CMake-don-t-build-dynamic-zlib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 4cb6185abc1f6a4fec7d6e7e1ed1a607e0ec1511 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <[email protected]>
Date: Sun, 5 Jan 2025 15:22:00 +0100
Subject: [PATCH] CMake: don't build dynamic zlib

---
CMakeLists.txt | 33 ++++++---------------------------
1 file changed, 6 insertions(+), 27 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15ceebe..55122a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -149,37 +149,16 @@ if(MINGW)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)

-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
-set_target_properties(zlib PROPERTIES SOVERSION 1)
-
-if(NOT CYGWIN)
- # This property causes shared libraries on Linux to have the full version
- # encoded into their final filename. We disable this on Cygwin because
- # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
- # seems to be the default.
- #
- # This has no effect with MSVC, on that platform the version info for
- # the DLL comes from the resource file win32/zlib1.rc
- set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
-endif()

if(UNIX)
# On unix-like platforms the library is almost always called libz
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
- if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
- set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
- endif()
-elseif(BUILD_SHARED_LIBS AND WIN32)
- # Creates zlib1.dll when building shared library version
- set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
+ set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)
endif()

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS zlib zlibstatic
+ install(TARGETS zlibstatic
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )
@@ -199,20 +178,20 @@ endif()
#============================================================================
if(ZLIB_BUILD_EXAMPLES)
add_executable(example test/example.c)
- target_link_libraries(example zlib)
+ target_link_libraries(example zlibstatic)
add_test(example example)

add_executable(minigzip test/minigzip.c)
- target_link_libraries(minigzip zlib)
+ target_link_libraries(minigzip zlibstatic)

if(HAVE_OFF64_T)
add_executable(example64 test/example.c)
- target_link_libraries(example64 zlib)
+ target_link_libraries(example64 zlibstatic)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)

add_executable(minigzip64 test/minigzip.c)
- target_link_libraries(minigzip64 zlib)
+ target_link_libraries(minigzip64 zlibstatic)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
endif()
--
2.39.5 (Apple Git-154)

Loading