mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
Use Host ZLib In CMake Builds
The vendored ZLib is still in the repo for VS builds.
This commit is contained in:
committed by
iProgramInCpp
parent
fdf3106d7e
commit
e9ddb5ab61
@@ -269,27 +269,40 @@ add_library(reminecraftpe-core STATIC
|
||||
renderer/GL/GL.cpp
|
||||
)
|
||||
|
||||
target_include_directories(reminecraftpe-core PUBLIC . .. ../thirdparty/zlib)
|
||||
target_include_directories(reminecraftpe-core PUBLIC . ..)
|
||||
|
||||
# RakNet
|
||||
add_subdirectory(../thirdparty/raknet raknet)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC raknet)
|
||||
|
||||
# zlib
|
||||
add_subdirectory(../thirdparty/zlib zlib)
|
||||
add_library(zlib INTERFACE)
|
||||
if(EMSCRIPTEN)
|
||||
# Use Emscripten's ZLib
|
||||
set(ZLIB_FLAG -sUSE_ZLIB=1)
|
||||
target_compile_options(zlib INTERFACE "${ZLIB_FLAG}")
|
||||
target_link_options(zlib INTERFACE "${ZLIB_FLAG}")
|
||||
else()
|
||||
# Use System ZLib
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(zlib INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
target_link_libraries(reminecraftpe-core PUBLIC zlib)
|
||||
|
||||
# SDL
|
||||
if(USE_SDL)
|
||||
add_library(SDL INTERFACE)
|
||||
if(ANDROID)
|
||||
# Use Vendored SDL2 (Only For Android)
|
||||
add_subdirectory(../thirdparty/SDL-src SDL EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(SDL INTERFACE SDL2::SDL2)
|
||||
elseif(EMSCRIPTEN)
|
||||
# Use Emscripten's SDL2
|
||||
set(SDL_FLAG -sUSE_SDL=2)
|
||||
target_compile_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
target_link_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
else()
|
||||
# Use System SDL2
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_link_libraries(SDL INTERFACE SDL2::SDL2)
|
||||
endif()
|
||||
@@ -310,9 +323,6 @@ if(USE_SDL)
|
||||
if(EMSCRIPTEN)
|
||||
target_link_options(reminecraftpe-core PUBLIC -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2)
|
||||
endif()
|
||||
else()
|
||||
find_package(OpenGL REQUIRED)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC OpenGL::OpenGL OpenGL::GLU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user