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
37 changes: 28 additions & 9 deletions .github/workflows/MediaInfoLib_Checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Checks
on: [push, pull_request]

jobs:
Unix:
Build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
environement: [gcc, utf8, minified, minimal, minimal-with-xml, cmake]
exclude:
- os: macos-latest
Expand All @@ -15,6 +15,16 @@ jobs:
environement: minimal
- os: macos-latest
environement: minimal-with-xml
- os: windows-latest
environement: gcc
- os: windows-latest
environement: utf8
- os: windows-latest
environement: minified
- os: windows-latest
environement: minimal
- os: windows-latest
environement: minimal-with-xml
include:
- environement: gcc
CXXFLAGS: ""
Expand All @@ -40,8 +50,9 @@ jobs:
RUN_TESTS: ${{ matrix.RUN_TESTS }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Dependencies
if: ${{ runner.os != 'Windows' }}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
Expand All @@ -50,6 +61,10 @@ jobs:
if [ "$RUNNER_OS" == "macOS" ]; then
brew install libtool automake
fi
- name: zlib
if: ${{ runner.os == 'Windows' }}
run: |
git -C .. clone --depth=1 https://github.com/MediaArea/zlib.git
- name: ZenLib
run: |
git -C .. clone --depth=1 https://github.com/MediaArea/ZenLib.git
Expand Down Expand Up @@ -82,31 +97,35 @@ jobs:
make check
- name: CMake Build
if: ${{ matrix.environement == 'cmake' }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export CXXFLAGS="/std:c++20 /WX /MP"
fi
mkdir Project/CMake/Build
cd Project/CMake/Build
cmake -DBUILD_ZENLIB=1 ..
make -j4
cmake -DBUILD_ZENLIB=1 -DZLIB_BUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
cmake --build . ${{ runner.os == 'Windows' && '--config Release' || '-j4' }}

Windows:
MSBuild:
runs-on: windows-latest
strategy:
matrix:
architecture: [ Win32, x64, ARM64 ]
fail-fast: false
steps:
- name: Checkout zlib
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: MediaArea/zlib
path: zlib
- name: Checkout ZenLib
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: MediaArea/ZenLib
path: ZenLib
- name: Checkout MediaInfoLib
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: MediaInfoLib
- name: Add msbuild to PATH
Expand Down
12 changes: 8 additions & 4 deletions Project/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5.0)
cmake_minimum_required(VERSION 3.5.0...3.31)

project(MediaInfoLib)

Expand All @@ -23,6 +23,10 @@ else()
option(BUILD_ZENLIB "Build bundled ZenLib" ON)
endif()

if (MSVC)
string(APPEND CMAKE_CXX_FLAGS " /EHsc")
endif()

set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE STRING "Directory where binary will install")
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Directory where library will install")
Expand Down Expand Up @@ -57,10 +61,10 @@ if (NOT BUILD_ZLIB)
else()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
if(NOT BUILD_SHARED_LIBS)
set(ZLIB_LIBRARIES "${LIB_INSTALL_DIR}/$<TARGET_LINKER_FILE_NAME:zlibstatic>")
set(ZLIB_LIBRARIES ZLIB::ZLIBSTATIC)
endif()
if(UNIX AND BUILD_SHARED_LIBS)
target_compile_options(zlibstatic PRIVATE -fPIC)
target_compile_options(ZLIB::ZLIBSTATIC PRIVATE -fPIC)
endif()
set(ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../../zlib ${CMAKE_CURRENT_BINARY_DIR}/zlib)
endif()
Expand Down Expand Up @@ -383,7 +387,7 @@ add_library(mediainfo ${MediaInfoLib_SRCS})
target_include_directories(mediainfo INTERFACE ${INCLUDE_INSTALL_DIR})

if(BUILD_ZLIB)
add_dependencies(mediainfo zlibstatic)
add_dependencies(mediainfo ZLIB::ZLIBSTATIC)
endif()

# disable some features. Maybe it should be enabled.
Expand Down