Fix SDK Bugs

This commit is contained in:
TheBrokenRail 2022-06-25 23:03:46 -04:00
parent 2b920f50ba
commit 2f64552926
4 changed files with 32 additions and 18 deletions

View File

@ -24,17 +24,19 @@ endif()
set(ZLIB_LIBRARY zlibstatic) set(ZLIB_LIBRARY zlibstatic)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../zlib/src" "${CMAKE_CURRENT_BINARY_DIR}/../zlib/src") 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_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) add_subdirectory(src EXCLUDE_FROM_ALL)
set(CMAKE_POLICY_DEFAULT_CMP0054 NEW) # Re-Enable New Behavior set(CMAKE_POLICY_DEFAULT_CMP0054 NEW) # Re-Enable New Behavior
if(TARGET png12) 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 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 set_target_properties(png12 PROPERTIES DEBUG_POSTFIX "") # Fix LibPNG Suffix In Debug Mode
target_include_directories(png12 PUBLIC src) target_include_directories(png12 PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
endif() endif()
if(TARGET png12_static) if(TARGET png12_static)
find_library(M_LIBRARY NAMES m REQUIRED) target_link_libraries(png12_static "${ZLIB_LIBRARY}" m)
target_link_libraries(png12_static "${ZLIB_LIBRARY}" "${M_LIBRARY}") target_include_directories(png12_static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
target_include_directories(png12_static PUBLIC src)
else() else()
add_library(png12_static ALIAS png12) add_library(png12_static ALIAS png12)
endif() endif()
@ -49,4 +51,6 @@ endif()
# Install # Install
if(TARGET png12) if(TARGET png12)
install(TARGETS png12 DESTINATION "${MCPI_LIB_DIR}") install(TARGETS png12 DESTINATION "${MCPI_LIB_DIR}")
# SDK
install(TARGETS png12 zlibstatic EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
endif() endif()

View File

@ -6,6 +6,7 @@ add_compile_options(-w)
## zlib ## zlib
# Download # Download
set(CMAKE_POLICY_DEFAULT_CMP0022 NEW) # Fix Error
add_subdirectory(src EXCLUDE_FROM_ALL) add_subdirectory(src EXCLUDE_FROM_ALL)
# Ensure Build # Ensure Build

View File

@ -1,21 +1,29 @@
# Installation # Installation
## AppImage
Download packages [here](https://jenkins.thebrokenrail.com/job/minecraft-pi-reborn/job/master/lastSuccessfulBuild/artifact/out/). 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-<Variant>_X.Y.Z_<Architecture> minecraft-pi-reborn-<Variant>_X.Y.Z_<Architecture>
``` ```
### Picking A Variant #### Picking A Variant
* ``client``: Client mode, use this if you want to play MCPI. * ``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. * ``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. * ``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). * ``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. * ``arm64``: ARM 64-Bit, ``armhf`` but for 64-bit devices.
## Running ## Flatpak
Follow [these](https://docs.appimage.org/introduction/quickstart.html#how-to-run-an-appimage) instructions. [![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``.

View File

@ -10,7 +10,7 @@ if(MCPI_USE_GLES1_COMPATIBILITY_LAYER AND BUILD_NATIVE_COMPONENTS AND NOT MCPI_H
set(GLES1_LINK_MODE "OBJECT") set(GLES1_LINK_MODE "OBJECT")
endif() 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) 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 # Install
if(NOT MCPI_USE_MEDIA_LAYER_PROXY) if(NOT MCPI_USE_MEDIA_LAYER_PROXY)
install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}") install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}")
@ -19,15 +19,16 @@ else()
# Add GLESv1_CM Stubs For Linking # Add GLESv1_CM Stubs For Linking
add_library(GLESv1_CM SHARED src/stubs.c) add_library(GLESv1_CM SHARED src/stubs.c)
# Install Fake GLESv1_CM Stubs In Server Mode # Install Fake GLESv1_CM Stubs In Server Mode
if(BUILD_ARM_COMPONENTS) if(BUILD_ARM_COMPONENTS AND MCPI_HEADLESS_MODE)
if(MCPI_HEADLESS_MODE) install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}")
install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}")
endif()
# SDK
install(TARGETS GLESv1_CM EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
endif() endif()
endif() endif()
# SDK
if(BUILD_ARM_COMPONENTS)
install(TARGETS GLESv1_CM EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
endif()
# Common # 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") set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1")