Skip to content
Open
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
67 changes: 67 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: windows
on:
push:
pull_request:

jobs:
build:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
include:
- CC: gcc
CXX: g++
- CC: cl
CXX: cl
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
steps:
- uses: actions/checkout@v2

- name: Cache Msys2
if: matrix.CC == 'gcc'
id: cache-msys2
uses: actions/cache@v1.1.2
with:
path: msys64
key: ${{ runner.os }}-msys64-${{ hashFiles('**/*.db') }}

- name: Setup msys2 (mingw-w64)
if: matrix.CC == 'gcc' && steps.cache-msys2.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Outfile msys2.tar.xz -Uri "https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.tar.xz"
xz -d msys2.tar.xz
tar -xf msys2.tar
rm msys2.tar
- name: Add msys2 to path (mingw-w64)
if: matrix.CC == 'gcc'
run: |
Write-Output "::add-path::${env:GITHUB_WORKSPACE}/msys64/mingw64/bin"
Write-Output "::add-path::${env:GITHUB_WORKSPACE}/msys64/usr/bin"
- name: Run bash for first time (mingw-w64)
if: matrix.CC == 'gcc' && steps.cache-msys2.outputs.cache-hit != 'true'
shell: cmd
run: bash -lc 'exit'
- name: Install packages (mingw-w64)
if: matrix.CC == 'gcc'
run: |
pacman -Syy
pacman -Suu --ask=20 --needed --noconfirm
pacman -S --ask=20 --needed --noconfirm `
mingw-w64-x86_64-gcc `
mingw-w64-x86_64-cmake `
mingw-w64-x86_64-openmp
pacman -Scc --ask=20

- name: Run CMake
run: |
if ($env:CC -eq "cl") {
cmake -S . -B build -G"Visual Studio 16 2019" -A x64
} else {
cmake -S . -B build -G"Unix Makefiles"
}
- name: Build
run: |
cmake --build build -j 4
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ endif (WIN32)

if (UNIX)
SET(COMPILER_FLAGS -fPIC)
SET(ADDITIONAL_LIBS "-luuid -lpthread")
SET(ADDITIONAL_LIBS -luuid -lpthread)
SET(TOY_LIBS "-lm")
endif (UNIX)

if (APPLE)
SET(COMPILER_FLAGS -fvisibility=hidden)
SET(ADDITIONAL_LIBS "-lpthread")
SET(ADDITIONAL_LIBS -lpthread)
endif (APPLE)

if (OPENMP_FOUND)
add_definitions(-DHAVE_OPENMP=1)
SET(ADDITIONAL_LIBS "${ADDITIONAL_LIBS} ${OpenMP_CXX_FLAGS}")
SET(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${OpenMP_CXX_FLAGS})
endif (OPENMP_FOUND)

include_directories("Common" "Tables" "Codec" "ConvertLib" "WarpLib" "Example")
Expand All @@ -48,18 +48,18 @@ if (BUILD_LIBS)
add_library(CFHDEncoderStatic STATIC ${CODEC_SOURCES} ${ENCODER_SOURCES})
add_library(CFHDDecoderStatic STATIC ${CODEC_SOURCES} ${DECODER_SOURCES})
target_compile_options(CFHDEncoderStatic PUBLIC ${COMPILER_FLAGS})
target_compile_options(CFHDDecoderStatic PUBLIC ${COMPILER_FLAGS})
target_compile_options(CFHDDecoderStatic PUBLIC ${COMPILER_FLAGS})
target_link_libraries (CFHDEncoderStatic)
target_link_libraries (CFHDDecoderStatic)
else (BUILD_SEPARATED)
add_library(CFHDCodecStatic STATIC ${CODEC_SOURCES} ${ENCODER_SOURCES} ${DECODER_SOURCES})
target_compile_options(CFHDCodecStatic PUBLIC ${COMPILER_FLAGS})

set_target_properties(CFHDCodecStatic PROPERTIES POSITION_INDEPENDENT_CODE ON)
if (UNIX)
set_target_properties(CFHDCodecStatic PROPERTIES OUTPUT_NAME CFHDCodec)
endif (UNIX)

target_link_libraries(CFHDCodecStatic)
endif (BUILD_SEPARATED)
else (BUILD_STATIC)
Expand Down Expand Up @@ -119,6 +119,7 @@ set(EXEC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Installation prefix
set(BIN_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/bin CACHE PATH "Installation prefix for user executables" FORCE)
set(LIB_INSTALL_DIR ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE PATH "Installation prefix for object code libraries" FORCE)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/cineformsdk CACHE PATH "Installation prefix for header files" FORCE)
string(REPLACE ";" " " ADDITIONAL_LIBS "${ADDITIONAL_LIBS}")

# System wide installation
if (BUILD_STATIC)
Expand Down