Skip to content

Commit

Permalink
Add github action and bump CMake to 3.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Bensuperpc <[email protected]>
  • Loading branch information
bensuperpc authored and sezero committed Nov 13, 2021
1 parent c44477b commit d4e30cc
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 3 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: linux

on:
push:
branches:
- "*"
paths-ignore:
- "**.md"
pull_request:
branches:
- "*"
workflow_dispatch:

jobs:
build-cmake:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: ["gcc", "clang"]
shared: [YES, NO]
build_type: [Release]

steps:
- name: "Checkout Code"
uses: actions/checkout@v2
with:
submodules: "recursive"
fetch-depth: 0

- name: dependencies
run: |
sudo apt -y update
sudo apt -y install ninja-build libsdl2-dev
- name: Configure CMake
env:
CC: ${{matrix.compiler}}
run: |
cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.build_type}} \
-G Ninja -D BUILD_SHARED_LIBS=${{matrix.shared}}
- name: Build CMake
run: ninja -C build
build-make:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: ["gcc", "clang"]

steps:
- name: "Checkout Code"
uses: actions/checkout@v2
with:
submodules: "recursive"
fetch-depth: 0

- name: dependencies
run: |
sudo apt -y update
sudo apt -y install libsdl2-dev
- name: Configure make
env:
CC: ${{matrix.compiler}}
run: |
./configure
- name: Build make
run: make -j2
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.0.0)
project(SDL_mixer C)

# FIXME: make it able build against system codec libraries, too.
Expand All @@ -14,9 +14,14 @@ option(SUPPORT_MP3_MPG123 "Support loading MP3 music via MPG123" OFF)
option(SUPPORT_MOD_MODPLUG "Support loading MOD music via modplug" OFF)
option(SUPPORT_MID_TIMIDITY "Support TiMidity" OFF)

option(BUILD_SHARED_LIBS "Enable shared library" ON)

find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR})

include_directories(include src src/codecs)

add_library(SDL2_mixer SHARED)
add_library(SDL2_mixer)

target_sources(SDL2_mixer PRIVATE
src/effect_position.c src/effects_internal.c src/effect_stereoreverse.c
Expand Down Expand Up @@ -64,5 +69,5 @@ if (SUPPORT_MID_TIMIDITY)
endif()

target_include_directories(SDL2_mixer PUBLIC include)
target_link_libraries(SDL2_mixer PRIVATE SDL2)
target_link_libraries(SDL2_mixer PRIVATE ${SDL2_LIBRARIES} ${SDL2_LIBRARY})

0 comments on commit d4e30cc

Please sign in to comment.