mirror of
https://github.com/stenzek/duckstation.git
synced 2026-07-11 01:24:11 +02:00
GPUDevice: Pack shaderc/spirv-cross function pointers together
This commit is contained in:
@@ -138,7 +138,7 @@ if(NOT WIN32)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(FFMPEG 8.1.0 COMPONENTS avcodec avformat avutil swresample swscale)
|
||||
find_package(FFMPEG 8.1.1 COMPONENTS avcodec avformat avutil swresample swscale)
|
||||
if(NOT FFMPEG_FOUND)
|
||||
message(WARNING "FFmpeg not found, using bundled headers.")
|
||||
endif()
|
||||
|
||||
@@ -378,3 +378,38 @@ function(add_resources TARGET DEST_SUBDIR SOURCE_DIR)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(bundle_libraries TARGET)
|
||||
unset(LIBRARY_SOURCES)
|
||||
foreach(NAME IN LISTS ARGN)
|
||||
get_target_property(dyn_lib_path ${NAME} IMPORTED_LOCATION_RELEASE)
|
||||
get_target_property(dyn_lib_soname ${NAME} IMPORTED_SONAME_RELEASE)
|
||||
if(dyn_lib_soname)
|
||||
string(REPLACE "@rpath/" "" dyn_lib_soname_filename "${dyn_lib_soname}")
|
||||
get_filename_component(dyn_lib_dir "${dyn_lib_path}" DIRECTORY)
|
||||
set(dyn_lib_major_path "${dyn_lib_dir}/${dyn_lib_soname_filename}")
|
||||
if(EXISTS "${dyn_lib_major_path}")
|
||||
set(dyn_lib_path "${dyn_lib_major_path}")
|
||||
else()
|
||||
message(WARNING "Could not find major-versioned symlink for ${NAME}.")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find ${NAME}.")
|
||||
endif()
|
||||
|
||||
message(STATUS "Bundling imported library ${dyn_lib_soname}")
|
||||
|
||||
if(APPLE)
|
||||
target_sources(${target} PRIVATE "${dyn_lib_path}")
|
||||
set_source_files_properties("${dyn_lib_path}" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks)
|
||||
else()
|
||||
list(APPEND LIBRARY_SOURCES "${dyn_lib_path}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT APPLE)
|
||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIBRARY_SOURCES} "$<TARGET_FILE_DIR:${TARGET}>"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user