Skip to content

Commit

Permalink
Merge pull request #10 from cinnabar-engine/feature/platform-windows
Browse files Browse the repository at this point in the history
Windows Building Fix
  • Loading branch information
tumble1999 authored Aug 18, 2021
2 parents 78c0e93 + 55be96b commit d12156a
Show file tree
Hide file tree
Showing 21 changed files with 400 additions and 48 deletions.
101 changes: 100 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
sudo apt update -y
sudo apt upgrade -y
sudo apt install build-essential cmake libsdl2-dev libglew-dev libglm-dev libassimp-dev -y
chmod +x tests/debian.sh
- name: Configure
run: |
Expand Down Expand Up @@ -71,9 +72,63 @@ jobs:
name: arch-artifact
path: pkg/

Windows:
runs-on: windows-latest
env:
GLEW_PATH: C:\lib\glew-2.2.0\bin
SDL2DIR: C:\lib\SDL2-2.0.16
GLM_ROOT_DIR: C:\lib\glm
steps:
- name: Checkout Branch
uses: actions/checkout@v2-beta # use either @v2-beta or @master. Eventually there will be a @v2 tag.

- run: choco install wget unzip 7zip -y
- name: Install Dependencies
env:
GLEW_DOWNLOAD: https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip
GLM_DOWNLOAD: https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip
SDL2_DOWNLOAD: https://www.libsdl.org/release/SDL2-devel-2.0.16-VC.zip
run: |
mkdir c:/lib
wget -O glew.zip $env:GLEW_DOWNLOAD
wget -O sdl2.zip $env:SDL2_DOWNLOAD
wget -O glm.zip $env:GLM_DOWNLOAD
unzip glew.zip -d c:\lib
unzip sdl2.zip -d c:\lib
unzip glm.zip -d c:\lib
# vcpkg integrate install
# vcpkg install sdl2 glew glm
# # :: Install-Package sdl2 -Force
# # :: Install-Package glew -Force
# # # Install-Package glm -Force
- name: Configure
run: |
$env:Path += ";$env:GLEW_PATH"
echo $env:PATH
tests\windows.bat configure
- name: Build
run: |
tests\windows.bat build
- name: Package
run: |
tests\windows.bat package
- uses: actions/upload-artifact@v2
with:
name: windows-artifact
path: pkg/


Release:
runs-on: ubuntu-latest
needs: [Debian, Arch]
needs: [Debian, Arch, Windows]
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -83,6 +138,10 @@ jobs:
with:
name: arch-artifact

- uses: actions/download-artifact@v2
with:
name: windows-artifact

- name: release
uses: actions/create-release@v1
id: create_release
Expand Down Expand Up @@ -154,3 +213,43 @@ jobs:
asset_path: ./cinnabar-render.pkg.tar.zst
asset_name: cinnabar-render.pkg.tar.zst
asset_content_type: application/vnd.debian.binary-package

- name: cinnabar-core.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cinnabar-core.dll
asset_name: cinnabar-core.dll
asset_content_type: application/x-msdownload

- name: cinnabar-core.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cinnabar-core.zip
asset_name: cinnabar-core.zip
asset_content_type: application/zip

- name: cinnabar-render.dll
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cinnabar-render.dll
asset_name: cinnabar-render.dll
asset_content_type: application/x-msdownload

- name: cinnabar-render.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./cinnabar-render.zip
asset_name: cinnabar-render.zip
asset_content_type: application/zip
48 changes: 48 additions & 0 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
sudo apt update -y
sudo apt upgrade -y
sudo apt install build-essential cmake libsdl2-dev libglew-dev libglm-dev libassimp-dev -y
chmod +x tests/debian.sh
- name: Configure
run: |
Expand Down Expand Up @@ -52,3 +53,50 @@ jobs:
sudo docker stop ce-arch-test
sudo docker rm ce-arch-test -f
sudo docker rmi ce-arch -f
Windows:
runs-on: windows-latest
env:
GLEW_PATH: C:\lib\glew-2.2.0\bin
SDL2DIR: C:\lib\SDL2-2.0.16
GLM_ROOT_DIR: C:\lib\glm
steps:
- name: Checkout Branch
uses: actions/checkout@v2-beta # use either @v2-beta or @master. Eventually there will be a @v2 tag.

- run: choco install wget unzip 7zip -y
- name: Install Dependencies
env:
GLEW_DOWNLOAD: https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip
GLM_DOWNLOAD: https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip
SDL2_DOWNLOAD: https://www.libsdl.org/release/SDL2-devel-2.0.16-VC.zip
run: |
mkdir c:/lib
wget -O glew.zip $env:GLEW_DOWNLOAD
wget -O sdl2.zip $env:SDL2_DOWNLOAD
wget -O glm.zip $env:GLM_DOWNLOAD
unzip glew.zip -d c:\lib
unzip sdl2.zip -d c:\lib
unzip glm.zip -d c:\lib
# vcpkg integrate install
# vcpkg install sdl2 glew glm
# # :: Install-Package sdl2 -Force
# # :: Install-Package glew -Force
# # # Install-Package glm -Force
- name: Configure
run: |
$env:Path += ";$env:GLEW_PATH"
echo $env:PATH
tests\windows.bat configure
- name: Build
run: |
tests\windows.bat build
- name: Package
run: |
tests\windows.bat package
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dockerfile
!*/dockerfile

!packaging/*.sh
pkg
pkg
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
cmake_minimum_required(VERSION 3.18)
project(cinnabar VERSION 0.0.1)

#include(CTest)
Expand All @@ -8,11 +8,13 @@ set(CMAKE_CXX_STANDARD 17)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/arch)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/arch)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/dep/")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

add_subdirectory(dep)
add_subdirectory(src)
49 changes: 49 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Systems
* Core
* Time - Tumble
* Logger (Tumpnt Log) - Tumble, SArpnt
* Transform - Tumble
* Render
* Rendering Engine - SArpnt
* Asset Manager - SArpnt,Tumble
* Materials - SArpnt
* Meshes - SArpnt
* Textures - SArpnt
* Shaders - SArpnt
* Camera - SArpnt
* Window - SArpnt
## CI/CD
* CMakeLists - Tumble, SArpnt
* UnitTesting - Tumble
* Packging
* Arch (pkg) - Tumble
* Debian (deb) - Tumble
* Gentoo (tbz2) - n/a
* openSUSE (rpm) - n/a
* MacOS (rb) - n/a
* RedHat/Fedora (rpm) - n/a
* Windows (msi) - n/a
* Package Manager PPAs
* Arch (pacman) - Tumble
* Debian (apt) - Tumble
* Gentoo (emerge) - n/a
* MacOS (brew) - n/a
* RedHat/Fedora (dnf) - n/a
* openSUSE (zypper) - n/a
## Testing
* Arch - Sarpnt, Github Actions
* Debian - Tumble. Github Actions
* Gentoo - n/a
* MacOS - n/a
* RedHat/Fedora - n/a
* Windows - Tumble

## Platforms
* Arch - SArpnt
* Debian - Tumble
* Gentoo - n/a
* MacOS - n/a
* openSUSE - n/a
* RedHat/Fedora - n/a
* Windows - Tumble

52 changes: 39 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,29 @@
Use the build tool [CMake](https://cmake.org/install/) to build cinnabar.

### Windows
Choose Compiler:
* [Visual Studio](https://visualstudio.microsoft.com/)/[MSBuild](https://aka.ms/buildtools) - *[setup](#visual-studio-installer)*
* [MinGW](http://mingw-w64.org/doku.php/download) - *[setup](#msysmingw)*

[Visual Studio](https://visualstudio.microsoft.com/)
[VSCode](https://code.visualstudio.com/docs/cpp/config-msvc)
#### Visual Studio Installer
* Desktop development with C++ (C++ core desktop features)
* MSVC V142 - VS 2016 C++ x64/x86 build tools (Latest)
* Windows 10 SDK (10.0.19041.0)
Download the [dependancies](#Dependancies) and extract them to a folder and set the envirement variables of `GLM_ROOT_DIR` and `SDL2DIR` then add the bins of pkg and glew to path and put the .dll files in the res folder.

#### MinGW
```bash
pacman -Syu
pacman -Su
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
pacman -S cmake mingw-w64-x86_64-glew mingw-w64-x86_64-glm mingw-w64-x86_64-SDL2
```

##### pkg-config
in here https://download-fallback.gnome.org/binaries/
go to win32 or win34
the go to dependecites and pickup gettext-runtime and pkg-config that isnt a dev veriso
then go to glib and get the latest verison that isnt a dev verision
### Debian

```bash
Expand Down Expand Up @@ -54,17 +73,24 @@ cd res
../build/run/cinnabar-engine
```

## Libraries
## Dependancies
* [CMake](https://cmake.org/)
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
* [Simple Directmedia Layer](https://www.libsdl.org/)
* [GLEW](http://glew.sourceforge.net/)
* [OpenGL Mathematics](https://glm.g-truc.net/0.9.9/index.html)

- Build Pipeline: [CMake](https://cmake.org/)
- Window: [Simple Directmedia Layer](https://www.libsdl.org/)
- Rendering: [OpenGL](https://www.opengl.org/)
- OpenGL Extention Loader: [GLEW](http://glew.sourceforge.net/)
- Maths: [OpenGL Mathematics](https://glm.g-truc.net/0.9.9/index.html)
- Image: [STB Image](https://github.com/nothings/stb/blob/master/stb_image.h)
- Text Files: [std:fstream](https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/fstream.html)
- Logger: [Tumpnt Logger](https://github.com/Tumpnt/TumpntAudio/blob/master/src/core/tpnt_log.h)
- Time: [TumbleTime](https://github.com/tumble1999/tumble-time)
## Libraries
* Build Pipeline: [CMake](https://cmake.org/)
* Library Helper: [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
* Window: [Simple Directmedia Layer](https://www.libsdl.org/)
* Rendering: [OpenGL](https://www.opengl.org/)
* OpenGL Extention Loader: [GLEW](http://glew.sourceforge.net/)
* Maths: [OpenGL Mathematics](https://glm.g-truc.net/0.9.9/index.html)
* Image: [STB Image](https://github.com/nothings/stb/blob/master/stb_image.h)
* Text Files: [std:fstream](https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/fstream.html)
* Logger: [Tumpnt Logger](https://github.com/Tumpnt/TumpntAudio/blob/master/src/core/tpnt_log.h)
* Time: [TumbleTime](https://github.com/tumble1999/tumble-time)

## Contributing

Expand Down Expand Up @@ -138,7 +164,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc
- [ ] GUI
- [ ] Portals
- [ ] VR support
- [ ] Port to Windows
- [X] Port to Windows
- [ ] Port to MacOS
- [ ] Port to Emscripten
- [ ] Port to Android
Expand Down
Loading

0 comments on commit d12156a

Please sign in to comment.