2021-06-17 17:32:24 -04:00
|
|
|
project(media-layer-core)
|
|
|
|
|
2022-07-11 23:51:27 -04:00
|
|
|
# OpenGL
|
2023-12-25 17:29:30 -05:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
add_subdirectory(gles)
|
|
|
|
endif()
|
2022-07-11 23:51:27 -04:00
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
# Configuration
|
2022-07-13 16:46:33 -04:00
|
|
|
set(CORE_SRC src/base.cpp src/media.c $<TARGET_OBJECTS:media-layer-extras>) # SDL Re-Implementation Using GLFW
|
2021-09-11 23:18:12 -04: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 00:25:01 -04:00
|
|
|
else()
|
|
|
|
list(APPEND CORE_SRC src/audio/stubs.c)
|
2021-09-11 23:18:12 -04:00
|
|
|
endif()
|
2021-06-17 17:32:24 -04:00
|
|
|
|
|
|
|
# Build
|
2023-11-11 00:44:26 -05:00
|
|
|
add_library(media-layer-core-real SHARED ${CORE_SRC}) # Dependencies Are Setup Later
|
|
|
|
set_target_properties(media-layer-core-real PROPERTIES OUTPUT_NAME "media-layer-core")
|
|
|
|
if(BUILD_NATIVE_COMPONENTS)
|
|
|
|
add_library(media-layer-core ALIAS media-layer-core-real)
|
2022-07-08 00:25:01 -04:00
|
|
|
endif()
|
2023-11-11 00:44:26 -05:00
|
|
|
# Install
|
|
|
|
install(TARGETS media-layer-core-real DESTINATION "${MCPI_LIB_DIR}")
|
2021-06-17 17:32:24 -04:00
|
|
|
|
2022-07-02 18:14:23 -04:00
|
|
|
# Link
|
2023-12-25 17:29:30 -05:00
|
|
|
target_link_libraries(media-layer-core-real PUBLIC media-layer-headers PUBLIC reborn-util PUBLIC dl)
|
2022-07-02 18:14:23 -04:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
# OpenAL
|
|
|
|
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
|
2021-06-17 17:32:24 -04:00
|
|
|
# Link
|
2023-12-25 17:29:30 -05:00
|
|
|
target_link_libraries(media-layer-core-real PRIVATE "${OPENAL_LIBRARY}" PRIVATE m PRIVATE glfw PUBLIC GLESv1_CM PRIVATE LIB_LIEF)
|
2021-07-05 19:40:43 -04:00
|
|
|
endif()
|