Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
efafcd6
Create cmake-multi-platform.yml
Dequilla Jul 4, 2025
037ae60
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
714aa3d
Update install_deps.sh
Dequilla Jul 4, 2025
0a452d2
Removed SDL, whoops
Dequilla Jul 4, 2025
cf4b5a5
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
78059b2
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
96c182a
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
5c21f7f
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
fd266f8
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
4fa823b
Changed SDL3 to clone instead via git, more cross-distro and platform…
Dequilla Jul 4, 2025
45cf7e6
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
5cf9b18
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
a3f655a
Update cmake-multi-platform.yml
Dequilla Jul 4, 2025
ee97983
Update install_deps.sh
Dequilla Jul 4, 2025
a9435db
Update CMakeLists.txt
Dequilla Jul 4, 2025
45c2b51
Update CMakeLists.txt
Dequilla Jul 4, 2025
3b0248c
Added include_directories for SDL3 even though locally it still works.
Dequilla Jul 4, 2025
9a6b657
Added compiler output to confirm it in github actions.
Dequilla Jul 4, 2025
3e35991
Commented windows CI paths for now.
Dequilla Jul 4, 2025
e27c6d1
Rename cmake-multi-platform.yml to Lucent Build.yml
Dequilla Jul 4, 2025
a17d9de
Update and rename Lucent Build.yml to lucent_cross_platform_build.yml
Dequilla Jul 4, 2025
6ca183f
Whoops, no cl.exe on ubuntu..
Dequilla Jul 4, 2025
a5813c0
Build badge in readme.
Dequilla Jul 4, 2025
7bbec11
Merge branch 'ci' of github.com:Dequilla/Lucent into ci
Dequilla Jul 4, 2025
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
89 changes: 89 additions & 0 deletions .github/workflows/lucent_cross_platform_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Lucent Build

on:
push:
branches: [ "master", "ci" ]
pull_request:
branches: [ "master", "ci" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
#
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
matrix:
#os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
#- os: windows-latest
# c_compiler: cl
# cpp_compiler: cl
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
exclude:
#- os: windows-latest
# c_compiler: gcc
#- os: windows-latest
# c_compiler: clang
- os: ubuntu-latest
c_compiler: cl

steps:
- uses: actions/checkout@v4

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
./script/install_deps.sh
elif [ "$RUNNER_OS" == "Windows" ]; then
echo "$RUNNER_OS not yet supported for CI."
exit 1
else
echo "$RUNNER_OS not supported"
exit 1
fi
shell: bash

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}

- name: Build
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

#- name: Test
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
# # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest --build-config ${{ matrix.build_type }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CMakeCache.txt
###########
[Bb]in/
[Rr]elease/
[Vv]endor/

# clangd #
##########
Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
cmake_minimum_required(VERSION 3.5.2 FATAL_ERROR)
project(Lucent)

# Compiler
message("Using compiler ${CMAKE_CXX_COMPILER_ID}")

# Enable c++26
set(CMAKE_CXX_STANDARD 26)

# Export compile_commands.json for LSPs
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

# set the output directory for built objects.
# This makes sure that the dynamic library goes into the build directory automatically.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>")

# Dependencies directory
set(LucentDependencies ${PROJECT_SOURCE_DIR}/deps)

Expand All @@ -25,6 +33,10 @@ include_directories(${OUR_SRC_DIR} ${OUR_INC_DIR})
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})

# SDL3 (./script/install_deps.sh has to be run)
add_subdirectory(vendor/SDL EXCLUDE_FROM_ALL)
include_directories(vendor/SDL/include)

if(WIN32)
set(WIN_DEP_INCLUDES ${LucentDependencies}/include/Windows)

Expand Down Expand Up @@ -53,7 +65,7 @@ elseif(UNIX)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMAKE)

# Sets SDL2_INCLUDE_DIR and SDL2_LIBRARY
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
# find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)

# Sets GLEW libraries and includes
find_package(GLEW REQUIRED)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
█████▄▄██ ████████▀ ████████▀ ██████████ ▀█ █▀ ▄████▀
```

[![Lucent Build](https://github.com/Dequilla/Lucent/actions/workflows/lucent_cross_platform_build.yml/badge.svg?branch=master)](https://github.com/Dequilla/Lucent/actions/workflows/lucent_cross_platform_build.yml)

# A crossplatform game engine using OpenGL

## Contributing
Expand Down
1 change: 0 additions & 1 deletion SDL
Submodule SDL deleted from 7c11a8
14 changes: 12 additions & 2 deletions script/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ source /etc/os-release

case $ID in
ubuntu)
echo "Ubuntu Linux TODO"
echo "Ubuntu Linux"
sudo apt update
sudo apt install -y libglew-dev libassimp-dev libfreetype-dev
sudo apt install -y build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev \
libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev libx11-dev
;;

debian)
Expand All @@ -13,7 +22,8 @@ case $ID in

arch)
echo "Arch Linux"
sudo pacman -S sdl3 glew assimp freetype2
sudo pacman -S glew assimp freetype2
;;
esac

git clone https://github.com/libsdl-org/SDL.git vendor/SDL