Skip to content
Merged
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
92 changes: 36 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Code-Romeo-CI

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]

workflow_dispatch:

jobs:
Expand All @@ -15,63 +12,43 @@ jobs:
matrix:
include:
- os: windows-latest
compiler: msvc
c_compiler: cl
build_type: Release
build_type: r
- os: windows-latest
compiler: msvc
c_compiler: cl
build_type: Debug
- os: windows-latest
compiler: clang-cl
c_compiler: clang-cl
build_type: Release
- os: windows-latest
compiler: clang-cl
c_compiler: clang-cl
build_type: Debug
build_type: d
- os: windows-latest
compiler: clang
c_compiler: clang
build_type: Release
build_type: r
- os: windows-latest
compiler: clang
c_compiler: clang
build_type: Debug
build_type: d

- os: ubuntu-latest
compiler: gcc
c_compiler: gcc
build_type: Release
build_type: r
- os: ubuntu-latest
compiler: gcc
c_compiler: gcc
build_type: Debug
build_type: d
- os: ubuntu-latest
compiler: clang
c_compiler: clang
build_type: Release
build_type: r
- os: ubuntu-latest
compiler: clang
c_compiler: clang
build_type: Debug
build_type: d

- os: macos-latest
compiler: gcc
c_compiler: gcc
build_type: Release
build_type: r
- os: macos-latest
compiler: gcc
c_compiler: gcc
build_type: Debug
build_type: d
- os: macos-latest
compiler: clang
c_compiler: clang
build_type: Release
build_type: r
- os: macos-latest
compiler: clang
c_compiler: clang
build_type: Debug
build_type: d

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

Expand All @@ -89,24 +66,14 @@ jobs:
path: 'Code-Juliett'
submodules: 'recursive'

- name: Install Dependencies
working-directory: Code-Juliett
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install cmake ninja-build libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev pkgconf libgl1-mesa-dev xvfb
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install cmake ninja
elif [ "$RUNNER_OS" == "Windows" ]; then
winget install -e --id Kitware.CMake --accept-source-agreements --accept-package-agreements --silent
winget install -e --id Ninja-build.Ninja --accept-source-agreements --accept-package-agreements --silent
echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH
echo "C:\Program Files\Ninja" >> $env:GITHUB_PATH
fi
shell: bash
sudo apt update
sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev xvfb

- name: Add MSVC to PATH
if: runner.os == 'Windows' && matrix.compiler == 'msvc'
if: runner.os == 'Windows' && matrix.c_compiler == 'cl'
uses: ilammy/msvc-dev-cmd@v1

- name: Swap Code-Romeo with the version under test
Expand All @@ -115,22 +82,35 @@ jobs:
mv Code-Romeo Code-Juliett/dependencies/Romeo
shell: bash

- name: Configure and Build
- name: Build shuildJuliett
working-directory: Code-Juliett
run: |
${{ matrix.c_compiler }} shuildJuliett.c -O3 -o shuildJuliett${{ runner.os == 'Windows' && '.exe' || '' }}
shell: bash

- name: Build Code-Juliett
working-directory: Code-Juliett
run: |
mkdir build
cd build
cmake -S .. -G Ninja -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build .
./shuildJuliett${{ runner.os == 'Windows' && '.exe' || '' }} ${{ matrix.c_compiler }} ${{ matrix.build_type }} all
shell: bash

- name: Run graphical app
working-directory: Code-Juliett
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
xvfb-run -a --server-args="-screen 0 1024x768x24" build/bin/Code-Juliett &
xvfb-run -a --server-args="-screen 0 1024x768x24" build/${{ matrix.build_type }}/Code-Juliett &
APP_PID=$!
sleep 5
kill $APP_PID
elif [ "$RUNNER_OS" == "macOS" ]; then
build/${{ matrix.build_type }}/Code-Juliett &
APP_PID=$!
sleep 5
kill $APP_PID
elif [ "$RUNNER_OS" == "Windows" ]; then
./build/${{ matrix.build_type }}/Code-Juliett.exe &
APP_PID=$!
sleep 5
taskkill /F /PID $APP_PID
fi
shell: bash
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

*.o
*.exe

# User-specific files
ignore.*
*.env
Expand Down
140 changes: 0 additions & 140 deletions CMakeLists.txt

This file was deleted.

32 changes: 6 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Code-Romeo

* This framework library project is a cross platform project to try out some new rendering concepts, techniques and design patterns in the C programming language.
* Guide to install the framework explained above.
* Usage and examples of the framework can be found in my [Code-Juliett](https://github.com/omerfuyar/Code-Juliett) repository.
* Because I do not have any Mac, I am not able to test anything on MacOS. So some parts of the software may not be working correctly.
* To see the development guidelines and other details please check [CONTRIBUTING.md](./CONTRIBUTING.md).
Expand All @@ -14,40 +13,21 @@ cd Code-Romeo

## Dependencies

* Library dependencies of the project is included and handled all by cmake. So user is not responsible for getting packages for runtime. You just need to install depended packages, if have any, and clone the repo with submodules.
* Library dependencies of the project is included and handled all by the project itself. So user is not responsible for getting packages manually. You just need to install depended packages, clone the repo with submodules and compile & run the build source which will be explained in build section.
* GLFW and CGLM are subdirectories (which cloned with the clone command at the top) are compiled statically and linked to the main application. Other dependencies are just files and they may or may not be edited by me 😁

### `CMake` for build system

### `Ninja` for the build system generator

### `OpenGL 3.3` for rendering

### Commands to install all

#### Linux
``` shell
sudo apt install cmake ninja-build libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev pkgconf xvfb
```

#### MacOS
### Linux commands to install dependencies
``` shell
brew install cmake ninja
```

#### Windows
``` powershell
winget install -e --id Kitware.CMake
winget install -e --id Ninja-build.Ninja
sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev xvfb
```

## Build

* Project supports clang/clang-cl, msvc and gcc compilers. Clang is prioritized all the time because it is much easier to use as a developer and produces higher performance binary especially compared to msvc.
* Project uses my own [build library](https://github.com/omerfuyar/shuild) to build all sub dependencies. User just needs to compile the shuildRomeo.c to build static libraries into build/release/. I will use clang for examples but you can use your own (clang/gcc/msvc).

``` shell
mkdir build
cd build
cmake -S .. -G Ninja -DCMAKE_C_COMPILER=<COMPILER> -DCMAKE_BUILD_TYPE=Release
cmake --build .
clang shuildRomeo.c -o shuildRomeo -O3
./shuildRomeo clang r
```
Loading
Loading