-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to CMake as build system and Woodpecker CI
- Loading branch information
Showing
5 changed files
with
188 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
- 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 -j4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: -DTLX_MORE_TESTS=ON | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# CMakeLists.txt | ||
# | ||
# Build script for The Sound of Sorting | ||
# | ||
############################################################################### | ||
# Copyright (C) 2024 Timo Bingmann <tb@panthema.net> | ||
# | ||
# 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.5) | ||
|
||
project(sound-of-sorting) | ||
|
||
add_definitions(-DPACKAGE_VERSION="0.7.0") | ||
|
||
# custom cmake scripts | ||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
|
||
# 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 wxGTK 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
############################################################################### | ||
# CMakeLists.txt | ||
# | ||
# Build script for The Sound of Sorting | ||
# | ||
############################################################################### | ||
# Copyright (C) 2024 Timo Bingmann <tb@panthema.net> | ||
# | ||
# 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/>. | ||
############################################################################### | ||
|
||
include_directories(${SDL2_INCLUDE_DIRS}) | ||
|
||
add_library(sorting-algorithms | ||
SortAlgo.cpp | ||
SortAlgo.h | ||
SortArray.cpp | ||
SortArray.h | ||
SortSound.cpp | ||
algorithms/timsort.cpp | ||
algorithms/wikisort.cpp | ||
) | ||
|
||
add_executable(sound-of-sorting | ||
WMain.cpp | ||
WMain.h | ||
WSortView.cpp | ||
WSortView.h | ||
wxClickText.cpp | ||
wxClickText.h | ||
wxg/WAbout_wxg.cpp | ||
wxg/WAbout_wxg.h | ||
wxg/WMain_wxg.cpp | ||
wxg/WMain_wxg.h | ||
) | ||
|
||
target_link_libraries(sound-of-sorting | ||
sorting-algorithms ${wxWidgets_LIBRARIES} ${SDL2_LIBRARIES}) | ||
|
||
add_executable(sorting-test | ||
SortTest.cpp | ||
) | ||
|
||
target_link_libraries(sorting-test | ||
sorting-algorithms ${wxWidgets_LIBRARIES}) | ||
|
||
add_test(sorting-test sorting-test) |