From e492c4849e13d07b826fbabff204e3139e849283 Mon Sep 17 00:00:00 2001 From: Cyrill Raccaud Date: Sun, 2 Mar 2025 23:02:07 +0100 Subject: [PATCH 1/3] Add linux build instructions --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 277eeeb5..8b00db20 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,19 @@ Install devel packages for `SDL2` and `SDL2_mixer`.\ Compile with CMake; tested with GCC 10, Clang 11.\ To cross-compile for Windows, install a 64-bit version of mingw and its `SDL2` and `SDL2_mixer` distributions, then use the `mingwcc.cmake` toolchain. -[![Packaging status](https://repology.org/badge/tiny-repos/spacecadetpinball.svg)](https://repology.org/project/spacecadetpinball/versions) +```sh +apt update +sudo apt install libsdl2-dev libsdl2-mixer-dev + +cd ../path/to/SpaceCadetPinball +mkdir build +cd build +cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ # gcc +cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # clang +make -j$(nproc) # Build with all available CPU cores +``` + +[![Packaging status](https://repology.org/badge/tiny-repos/spacecadetpinball.svg)](https://repology.org/project/spacecadetpinball/versions) Some distributions provide a package in their repository. You can use those for easier dependency management and updates. From 25c74ce581e97153ea65cbce3a1b8bb163e90ed9 Mon Sep 17 00:00:00 2001 From: Cyrill Raccaud Date: Mon, 3 Mar 2025 09:48:18 +0100 Subject: [PATCH 2/3] README.md aktualisieren MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b00db20..da098758 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,7 @@ apt update sudo apt install libsdl2-dev libsdl2-mixer-dev cd ../path/to/SpaceCadetPinball -mkdir build -cd build +mkdir build && cd build cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ # gcc cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # clang make -j$(nproc) # Build with all available CPU cores From 8fd9f41dfb3e4d4b08cef42a2af9140009aa6672 Mon Sep 17 00:00:00 2001 From: Cyrill Raccaud Date: Tue, 4 Mar 2025 19:48:27 +0100 Subject: [PATCH 3/3] specify debian and simplify cmake --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da098758..9bd0b899 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Download and unpack devel packages for `SDL2` and `SDL2_mixer`.\ Set paths to them in `CMakeLists.txt`, see suggested placement in `/Libs`.\ Compile with Visual Studio; tested with 2019. -### On Linux +### On Debian/Ubuntu Install devel packages for `SDL2` and `SDL2_mixer`.\ Compile with CMake; tested with GCC 10, Clang 11.\ @@ -75,9 +75,15 @@ sudo apt install libsdl2-dev libsdl2-mixer-dev cd ../path/to/SpaceCadetPinball mkdir build && cd build +cmake .. +make -j$(nproc) # Build with all available CPU cores +``` + +Use one of following commands instead to specify the compilers explicitly: + +```sh cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ # gcc cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # clang -make -j$(nproc) # Build with all available CPU cores ``` [![Packaging status](https://repology.org/badge/tiny-repos/spacecadetpinball.svg)](https://repology.org/project/spacecadetpinball/versions)