minecraft-pi-docker/media-layer/core/gles/CMakeLists.txt

33 lines
1.1 KiB
CMake
Raw Normal View History

2022-07-12 03:51:27 +00:00
project(media-layer-gles)
# Build
2022-07-13 15:58:35 +00:00
if(MCPI_HEADLESS_MODE)
# Stubs For Headless Mode
set(GLES_SRC src/stubs.c)
elseif(MCPI_USE_GLES1_COMPATIBILITY_LAYER)
# GLESv1_CM Compatibility Layer
set(GLES_SRC src/compatibility-layer/state.c src/compatibility-layer/passthrough.c src/compatibility-layer/matrix.c src/compatibility-layer/draw.c src/compatibility-layer/buffer.cpp)
else()
# Passthrough To glfwGetProcAddress()
set(GLES_SRC src/passthrough.c)
endif()
add_library(GLESv1_CM SHARED ${GLES_SRC})
2022-07-12 03:51:27 +00:00
if(NOT MCPI_HEADLESS_MODE)
target_link_libraries(GLESv1_CM PRIVATE glfw PUBLIC reborn-util PRIVATE dl PRIVATE m)
2022-07-30 02:13:03 +00:00
# Shaders
if(MCPI_USE_GLES1_COMPATIBILITY_LAYER)
embed_resource(GLESv1_CM src/compatibility-layer/shaders/main.vert)
embed_resource(GLESv1_CM src/compatibility-layer/shaders/main.frag)
endif()
2022-07-12 03:51:27 +00:00
endif()
# Common
target_link_libraries(GLESv1_CM PUBLIC media-layer-headers)
set_target_properties(GLESv1_CM PROPERTIES SOVERSION "1")
# Install
install(TARGETS GLESv1_CM DESTINATION "${MCPI_LIB_DIR}")
# SDK
if(BUILD_ARM_COMPONENTS)
install(TARGETS GLESv1_CM EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
endif()