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
63 changes: 44 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,33 @@ on:

jobs:
linux:
strategy:
fail-fast: false
matrix:
include:
- name: OpenGL ES
flags: "-DUSE_GLES1_COMPATIBILITY_LAYER=ON"
- name: OpenGL
flags: "-DUSE_GLES1_COMPATIBILITY_LAYER=OFF"
name: Linux (${{ matrix.name }})
name: Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y build-essential cmake ninja-build libopenal-dev libsdl2-dev zlib1g-dev
sudo apt-get install --no-install-recommends -y \
build-essential \
cmake ninja-build \
libopenal-dev \
libsdl2-dev zlib1g-dev
- name: Build
run: |
cd platforms/sdl
mkdir build
cd build
cmake -GNinja ${{ matrix.flags }} ..
cmake -GNinja ..
cmake --build .
wasm:
name: WASM
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
Expand All @@ -51,15 +46,16 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Install MacPorts
uses: melusina-org/setup-macports@v1
- name: Install Dependencies
run: |
sudo port install libsdl2 +universal
sudo port install libpng +universal
port selfupdate
port install libsdl2 +universal
port install libpng +universal
- name: Build macOS Archive
run: |
cd platforms/macos/projects/Minecraft
Expand Down Expand Up @@ -103,11 +99,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -116,3 +112,32 @@ jobs:
run: |
cd ${{ matrix.directory }}
./gradlew build
mingw:
strategy:
fail-fast: false
matrix:
include:
- name: Win32
flags: "-DREMCPE_PLATFORM=windows"
- name: SDL
flags: "-DREMCPE_PLATFORM=sdl"
name: MinGW-w64 (${{ matrix.name }})
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential \
cmake ninja-build \
mingw-w64
- name: Build
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-toolchain.cmake ${{ matrix.flags }} ..
cmake --build .
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ xcuserdata/
/sound_data

# Ignore linux/mingw build artifacts.
/build
/build*
/minecraftcpp
/minecraftcpp.exe

Expand Down Expand Up @@ -242,3 +242,11 @@ xcuserdata/
# Ignore options.txt - where your configuration will be saved
/game/options.txt
/game/assetsO
/game/assets/gui/feedback_fill.png
/game/assets/gui/feedback_outer.png
/game/assets/snow.png
/game/assets/mob/pig.png

# CLion
/.idea
/cmake-build-*
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "thirdparty/coi-serviceworker"]
path = thirdparty/coi-serviceworker
url = https://github.com/gzuidhof/coi-serviceworker.git
[submodule "thirdparty/gles-compatibility-layer"]
path = thirdparty/gles-compatibility-layer
url = https://github.com/TheBrokenRail/gles-compatibility-layer.git
[submodule "thirdparty/SDL-src"]
path = thirdparty/SDL2/src
url = https://github.com/libsdl-org/SDL.git
Expand Down
64 changes: 64 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
cmake_minimum_required(VERSION 3.16.0)
project(reminecraftpe)

# Store Output In Top-Level Build Directory
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

# WASM
if(EMSCRIPTEN)
function(add_compile_and_link_options)
add_compile_options(${ARGV})
add_link_options(${ARGV})
endfunction()
set(CMAKE_EXECUTABLE_SUFFIX ".js")
add_link_options("$<$<CONFIG:DEBUG>:-gsource-map>")
add_link_options(-Wno-pthreads-mem-growth -sALLOW_MEMORY_GROWTH=1)
endif()

# Clang
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-inconsistent-missing-override -Wno-enum-compare-switch -Wno-register)
endif()

# Windows Linking
if(WIN32)
add_link_options(
-static-libgcc
-static-libstdc++
)
endif()

# HaikuOS Network Library
if(HAIKU)
link_libraries(network)
endif()

# Threading
if(EMSCRIPTEN)
add_compile_and_link_options(-pthread)
else()
find_package(Threads)
link_libraries(Threads::Threads)
endif()

# Android Logging
if(ANDROID)
link_libraries(log)
endif()

# stb_image And Other Libraries
add_subdirectory(thirdparty/stb_image EXCLUDE_FROM_ALL)

# Load Common Code
add_subdirectory(source)

# Load Platform-Specific Code
add_subdirectory(platforms)

# Assets
if(EMSCRIPTEN)
target_link_options(reminecraftpe PRIVATE --use-preload-plugins --preload-file "${CMAKE_CURRENT_SOURCE_DIR}/game@/")
else()
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/game/assets" "${CMAKE_CURRENT_BINARY_DIR}/assets" SYMBOLIC)
endif()
71 changes: 0 additions & 71 deletions Makefile

This file was deleted.

86 changes: 0 additions & 86 deletions MakefileMinGW

This file was deleted.

Loading