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

switch to CMake as build system and Woodpecker CI #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .woodpecker/build-test-mxe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
when:
- event: pull_request
- event: manual
- event: push
repo: bingmann/sound-of-sorting
branch: master

matrix:
include:
- IMAGE: mxe-24.04-1
BUILD_TYPE: Release
C_COMPILER: gcc
CXX_COMPILER: g++
CXX_FLAGS:
CMAKE_FLAGS:

steps:
- name: build
image: docker.io/bingmann/dev:${IMAGE}
commands:
- /opt/mxe/usr/bin/i686-w64-mingw32.static-cmake --version
- mkdir build && cd build
- /opt/mxe/usr/bin/i686-w64-mingw32.static-cmake ${CMAKE_FLAGS}
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
-DCMAKE_CXX_COMPILER="${CXX_COMPILER}"
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}"
-DCMAKE_C_COMPILER="${C_COMPILER}"
..
- make VERBOSE=1 -j4
38 changes: 38 additions & 0 deletions .woodpecker/build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
when:
- event: pull_request
- event: manual
- event: push
repo: bingmann/sound-of-sorting
branch: master

matrix:
include:
- IMAGE: ubuntu-24.04
BUILD_TYPE: Debug
C_COMPILER: gcc
CXX_COMPILER: g++
CXX_FLAGS:
CMAKE_FLAGS:

- IMAGE: ubuntu-24.04
BUILD_TYPE: Release
C_COMPILER: gcc
CXX_COMPILER: g++
CXX_FLAGS:
CMAKE_FLAGS:

steps:
- name: build
image: docker.io/bingmann/dev:${IMAGE}
commands:
- cmake --version
- mkdir build && cd build
- cmake ${CMAKE_FLAGS}
-G Ninja
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}"
-DCMAKE_CXX_COMPILER="${CXX_COMPILER}"
-DCMAKE_CXX_FLAGS="${CXX_FLAGS}"
-DCMAKE_C_COMPILER="${C_COMPILER}"
..
- ninja
- ninja test
62 changes: 62 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
###############################################################################
# CMakeLists.txt
#
# Build script for The Sound of Sorting
#
###############################################################################
# Copyright (C) 2024 Timo Bingmann <[email protected]>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
###############################################################################

cmake_minimum_required(VERSION 3.10)

project(sound-of-sorting)

add_definitions(-DPACKAGE_VERSION="0.7.0")

# prohibit in-source builds
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(SEND_ERROR "In-source builds are not allowed.")
endif()

# default to Debug building for single-config generators
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Defaulting CMAKE_BUILD_TYPE to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()

# enable warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall")

# enable use of "make test"
enable_testing()

### Find wxWidgets Libraries ###

find_package(wxWidgets REQUIRED COMPONENTS adv core base)
if(wxWidgets_USE_FILE)
include(${wxWidgets_USE_FILE})
endif()

### Find SDL2 Libraries ###

find_package(SDL2 REQUIRED)

### Done with Libraries ###

# descend into source
add_subdirectory(src)

################################################################################
6 changes: 0 additions & 6 deletions Makefile.am

This file was deleted.

Loading