2021-06-17 21:32:24 +00:00
|
|
|
project(media-layer-core)
|
|
|
|
|
2022-07-02 22:14:23 +00:00
|
|
|
# Dependencies
|
|
|
|
add_subdirectory(dependencies)
|
|
|
|
|
2022-07-12 03:51:27 +00:00
|
|
|
# OpenGL
|
|
|
|
add_subdirectory(gles)
|
|
|
|
|
2021-06-17 21:32:24 +00:00
|
|
|
# Configuration
|
2022-07-13 20:46:33 +00:00
|
|
|
set(CORE_SRC src/base.cpp src/media.c $<TARGET_OBJECTS:media-layer-extras>) # SDL Re-Implementation Using GLFW
|
2021-09-12 03:18:12 +00:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
list(APPEND CORE_SRC src/audio/api.cpp src/audio/engine.c src/audio/file.cpp)
|
2022-07-08 04:25:01 +00:00
|
|
|
else()
|
|
|
|
list(APPEND CORE_SRC src/audio/stubs.c)
|
2021-09-12 03:18:12 +00:00
|
|
|
endif()
|
2021-06-17 21:32:24 +00:00
|
|
|
|
|
|
|
# Build
|
2022-07-02 22:14:23 +00:00
|
|
|
add_library(media-layer-core SHARED ${CORE_SRC}) # Dependencies Are Setup Later
|
|
|
|
# Install
|
|
|
|
install(TARGETS media-layer-core DESTINATION "${MCPI_LIB_DIR}")
|
2022-07-08 04:25:01 +00:00
|
|
|
if(BUILD_ARM_COMPONENTS)
|
|
|
|
install(TARGETS media-layer-core EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
|
|
|
|
endif()
|
2021-06-17 21:32:24 +00:00
|
|
|
|
2022-07-02 22:14:23 +00:00
|
|
|
# Link
|
2022-07-13 23:32:08 +00:00
|
|
|
target_link_libraries(media-layer-core PUBLIC media-layer-headers PUBLIC reborn-util PUBLIC GLESv1_CM PUBLIC dl)
|
2022-07-02 22:14:23 +00:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
# OpenAL
|
|
|
|
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
|
2021-06-17 21:32:24 +00:00
|
|
|
# Link
|
2022-09-25 19:47:36 +00:00
|
|
|
target_link_libraries(media-layer-core PRIVATE "${OPENAL_LIBRARY}" PRIVATE m PRIVATE glfw PRIVATE LIB_LIEF)
|
2021-07-05 23:40:43 +00:00
|
|
|
endif()
|