rpcsx/3rdparty/CMakeLists.txt

79 lines
2.4 KiB
CMake
Raw Permalink Normal View History

2024-09-03 06:43:58 +00:00
add_subdirectory(crypto)
if(NOT xbyak_FOUND)
add_subdirectory(xbyak)
endif()
2024-09-03 06:43:58 +00:00
add_subdirectory(SPIRV-Headers)
add_subdirectory(SPIRV-Tools)
option(SPIRV_CROSS_SHARED "" off)
option(SPIRV_CROSS_STATIC "" on)
option(SPIRV_CROSS_ENABLE_GLSL "" on)
option(SPIRV_CROSS_ENABLE_HLSL "" off)
option(SPIRV_CROSS_ENABLE_MSL "" off)
option(SPIRV_CROSS_ENABLE_CPP "" off)
option(SPIRV_CROSS_ENABLE_REFLECT "" off)
option(SPIRV_CROSS_ENABLE_C_API "" off)
option(SPIRV_CROSS_ENABLE_UTIL "" off)
option(SPIRV_CROSS_CLI "" off)
option(SPIRV_CROSS_ENABLE_TESTS "" off)
option(SPIRV_CROSS_SKIP_INSTALL "" on)
add_subdirectory(SPIRV-Cross)
add_subdirectory(glslang)
if(NOT TARGET glslang::glslang-standalone)
add_executable(glslang::glslang-standalone ALIAS glslang-standalone)
endif()
if(NOT nlohmann_json_FOUND)
add_subdirectory(json)
endif()
2024-09-25 17:09:46 +00:00
2024-10-13 13:32:12 +00:00
add_subdirectory(LibAtrac9)
set(FFMPEG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/FFmpeg)
add_custom_command(
OUTPUT ${FFMPEG_PATH}/config.h
2024-10-18 19:36:51 +00:00
COMMAND ./configure --disable-libdrm --disable-vaapi --disable-vdpau --disable-zlib --disable-lzma
2024-10-13 13:32:12 +00:00
COMMENT "Configuring FFmpeg..."
WORKING_DIRECTORY ${FFMPEG_PATH}
)
add_custom_target(ffmpeg-configure DEPENDS ${FFMPEG_PATH}/config.h)
2024-10-13 17:19:33 +00:00
function(import_ffmpeg_library name)
2024-10-13 17:39:51 +00:00
if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(MAKE_COMMAND $(MAKE) -j$(nproc))
elseif (${CMAKE_GENERATOR} STREQUAL "Ninja")
set(MAKE_COMMAND make -j$$(nproc))
else()
set(MAKE_COMMAND make)
endif()
2024-10-13 17:19:33 +00:00
add_custom_command(
OUTPUT "${FFMPEG_PATH}/lib${name}/lib${name}.a"
2024-10-13 17:39:51 +00:00
COMMAND ${MAKE_COMMAND} -C ${FFMPEG_PATH} "lib${name}/lib${name}.a"
2024-10-13 17:19:33 +00:00
COMMENT "Building lib${name}/lib${name}.a"
DEPENDS ffmpeg-configure
WORKING_DIRECTORY ${FFMPEG_PATH}
)
2024-10-13 13:32:12 +00:00
2024-10-13 17:19:33 +00:00
add_custom_target(ffmpeg-build-${name} DEPENDS "${FFMPEG_PATH}/lib${name}/lib${name}.a")
2024-10-13 13:32:12 +00:00
add_library(ffmpeg::${name} STATIC IMPORTED GLOBAL)
set_property(TARGET ffmpeg::${name} PROPERTY IMPORTED_LOCATION "${FFMPEG_PATH}/lib${name}/lib${name}.a")
set_property(TARGET ffmpeg::${name} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FFMPEG_PATH}")
2024-10-13 17:19:33 +00:00
add_dependencies(ffmpeg::${name} ffmpeg-build-${name})
2024-10-13 13:32:12 +00:00
endfunction()
import_ffmpeg_library(avcodec)
import_ffmpeg_library(avformat)
import_ffmpeg_library(avfilter)
import_ffmpeg_library(avdevice)
import_ffmpeg_library(avutil)
import_ffmpeg_library(swscale)
import_ffmpeg_library(swresample)
import_ffmpeg_library(postproc)