mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-10-02 16:23:57 +08:00
cmake: use *_STATIC_* variables when linking to a static ffmpeg
This commit is contained in:
committed by
Sam Lantinga
parent
88f2fb9dcf
commit
ebf5e08fa1
@@ -87,6 +87,11 @@ jobs:
|
||||
run: |
|
||||
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
|
||||
|
||||
- name: Fix vita.toolchain.cmake
|
||||
run: |
|
||||
# cache PKG_CONFIG_PATH
|
||||
sed -i -E 's/set\( PKG_CONFIG_EXECUTABLE "\$\{VITASDK}\/bin\/arm-vita-eabi-pkg-config" )/set( PKG_CONFIG_EXECUTABLE "${VITASDK}\/bin\/arm-vita-eabi-pkg-config" CACHE PATH "Path of pkg-config executable" )/' ${VITASDK}/share/vita.toolchain.cmake
|
||||
|
||||
- name: Configure (CMake)
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja \
|
||||
|
||||
+80
-93
File diff suppressed because it is too large
Load Diff
@@ -2,13 +2,11 @@
|
||||
|
||||
function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
if("${_library}" MATCHES "${CMAKE_STATIC_LIBRARY_SUFFIX}$")
|
||||
set(_include_dirs ${_pc_prefix}_STATIC_INCLUDE_DIRS)
|
||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
||||
else()
|
||||
set(_include_dirs ${_pc_prefix}_INCLUDE_DIRS)
|
||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
||||
@@ -21,9 +19,6 @@ function(get_flags_from_pkg_config _library _pc_prefix _out_prefix)
|
||||
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
|
||||
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
|
||||
|
||||
set(${_out_prefix}_include_dirs
|
||||
"${${_include_dirs}}"
|
||||
PARENT_SCOPE)
|
||||
set(${_out_prefix}_compile_options
|
||||
"${${_cflags}}"
|
||||
PARENT_SCOPE)
|
||||
|
||||
+1
-2
@@ -184,9 +184,8 @@ endif()
|
||||
|
||||
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
|
||||
include("${SDL3_SOURCE_DIR}/cmake/FindFFmpeg.cmake")
|
||||
if(FFMPEG_FOUND)
|
||||
if(FFmpeg_FOUND)
|
||||
add_sdl_test_executable(testspriteffmpeg NO_C90 SOURCES testspriteffmpeg.c ${icon_bmp_header})
|
||||
target_include_directories(testspriteffmpeg PRIVATE ${FFMPEG_INCLUDE_DIRS})
|
||||
target_link_libraries(testspriteffmpeg PRIVATE ${FFMPEG_LIBRARIES})
|
||||
else()
|
||||
message(STATUS "Cannot find ffmpeg, skipping testspriteffmpeg")
|
||||
|
||||
Reference in New Issue
Block a user