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
2022-09-20 22:25:27 +00:00
set(GLES_SRC src/compatibility-layer/state.c src/compatibility-layer/passthrough.c src/compatibility-layer/matrix.c src/compatibility-layer/draw.c)
2022-07-13 15:58:35 +00:00
else()
# Passthrough To glfwGetProcAddress()
set(GLES_SRC src/passthrough.c)
endif()
2022-09-20 22:25:27 +00:00
add_library(GLESv1_CM OBJECT ${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)
2022-08-06 00:08:13 +00:00
embed_resource(GLESv1_CM src/compatibility-layer/shaders/main.vsh)
embed_resource(GLESv1_CM src/compatibility-layer/shaders/main.fsh)
2022-07-30 02:13:03 +00:00
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()