From 2f64552926e04634b5737c649d0086b711a28d06 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 25 Jun 2022 23:03:46 -0400 Subject: [PATCH] Fix SDK Bugs --- dependencies/libpng/CMakeLists.txt | 12 ++++++++---- dependencies/zlib/CMakeLists.txt | 1 + docs/INSTALL.md | 20 ++++++++++++++------ media-layer/gles/CMakeLists.txt | 17 +++++++++-------- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/dependencies/libpng/CMakeLists.txt b/dependencies/libpng/CMakeLists.txt index 88706dcf8..5347062cb 100644 --- a/dependencies/libpng/CMakeLists.txt +++ b/dependencies/libpng/CMakeLists.txt @@ -24,17 +24,19 @@ endif() set(ZLIB_LIBRARY zlibstatic) set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/src" "${CMAKE_CURRENT_BINARY_DIR}/../zlib/src") set(CMAKE_POLICY_DEFAULT_CMP0054 OLD) # Silence Warning +set(CMAKE_POLICY_DEFAULT_CMP0003 NEW) # Silence Warning +set(CMAKE_POLICY_DEFAULT_CMP0022 NEW) # Fix Error +set(M_LIBRARY m) # No Full Paths! add_subdirectory(src EXCLUDE_FROM_ALL) set(CMAKE_POLICY_DEFAULT_CMP0054 NEW) # Re-Enable New Behavior if(TARGET png12) set_target_properties(png12 PROPERTIES LINK_OPTIONS "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libpng.vers") # Use Symbol Versioning set_target_properties(png12 PROPERTIES DEBUG_POSTFIX "") # Fix LibPNG Suffix In Debug Mode - target_include_directories(png12 PUBLIC src) + target_include_directories(png12 PUBLIC "$") endif() if(TARGET png12_static) - find_library(M_LIBRARY NAMES m REQUIRED) - target_link_libraries(png12_static "${ZLIB_LIBRARY}" "${M_LIBRARY}") - target_include_directories(png12_static PUBLIC src) + target_link_libraries(png12_static "${ZLIB_LIBRARY}" m) + target_include_directories(png12_static PUBLIC "$") else() add_library(png12_static ALIAS png12) endif() @@ -49,4 +51,6 @@ endif() # Install if(TARGET png12) install(TARGETS png12 DESTINATION "${MCPI_LIB_DIR}") + # SDK + install(TARGETS png12 zlibstatic EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}") endif() diff --git a/dependencies/zlib/CMakeLists.txt b/dependencies/zlib/CMakeLists.txt index 591ed9aba..0e25b1abe 100644 --- a/dependencies/zlib/CMakeLists.txt +++ b/dependencies/zlib/CMakeLists.txt @@ -6,6 +6,7 @@ add_compile_options(-w) ## zlib # Download +set(CMAKE_POLICY_DEFAULT_CMP0022 NEW) # Fix Error add_subdirectory(src EXCLUDE_FROM_ALL) # Ensure Build diff --git a/docs/INSTALL.md b/docs/INSTALL.md index de328a01d..54ce671cc 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,21 +1,29 @@ # Installation + +## AppImage Download packages [here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/). -## Picking A Package +### Running +Follow [these](https://docs.appimage.org/introduction/quickstart.html#how-to-run-an-appimage) instructions. -### Name Format +### Picking A Package + +#### Name Format ``` minecraft-pi-reborn-_X.Y.Z_ ``` -### Picking A Variant +#### Picking A Variant * ``client``: Client mode, use this if you want to play MCPI. * ``server``: Server mode, use this if you want to host a dedicated MCPI server. -### Picking An Architecture +#### Picking An Architecture * ``amd64``: x86_64, use this if you are using a device with an AMD or Intel processor. * ``armhf``: ARM 32-Bit, use this if you are using an ARM device (like a Raspberry Pi). * ``arm64``: ARM 64-Bit, ``armhf`` but for 64-bit devices. -## Running -Follow [these](https://docs.appimage.org/introduction/quickstart.html#how-to-run-an-appimage) instructions. +## Flatpak +[![Download On Flathub](https://flathub.org/assets/badges/flathub-badge-en.svg)](https://flathub.org/apps/details/com.thebrokenrail.MCPIReborn) + +### Note +Game data is stored in ``~/.var/app/com.thebrokenrail.MCPIReborn/.minecraft-pi`` instead of ``~/.minecraft-pi``. diff --git a/media-layer/gles/CMakeLists.txt b/media-layer/gles/CMakeLists.txt index b690e2a80..83eb6211d 100644 --- a/media-layer/gles/CMakeLists.txt +++ b/media-layer/gles/CMakeLists.txt @@ -10,7 +10,7 @@ if(MCPI_USE_GLES1_COMPATIBILITY_LAYER AND BUILD_NATIVE_COMPONENTS AND NOT MCPI_H set(GLES1_LINK_MODE "OBJECT") endif() add_library(GLESv1_CM "${GLES1_LINK_MODE}" src/compatibility-layer/state.c src/compatibility-layer/passthrough.c src/compatibility-layer/matrix.c src/compatibility-layer/draw.c) - target_link_libraries(GLESv1_CM glfw reborn-util dl m) + target_link_libraries(GLESv1_CM PRIVATE glfw PUBLIC reborn-util PRIVATE dl PRIVATE m) # Install if(NOT MCPI_USE_MEDIA_LAYER_PROXY) install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") @@ -19,15 +19,16 @@ else() # Add GLESv1_CM Stubs For Linking add_library(GLESv1_CM SHARED src/stubs.c) # Install Fake GLESv1_CM Stubs In Server Mode - if(BUILD_ARM_COMPONENTS) - if(MCPI_HEADLESS_MODE) - install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") - endif() - # SDK - install(TARGETS GLESv1_CM EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}") + if(BUILD_ARM_COMPONENTS AND MCPI_HEADLESS_MODE) + install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") endif() endif() +# SDK +if(BUILD_ARM_COMPONENTS) + install(TARGETS GLESv1_CM EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}") +endif() + # Common -target_link_libraries(GLESv1_CM media-layer-headers) +target_link_libraries(GLESv1_CM PUBLIC media-layer-headers) set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1")