mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-01 03:57:17 +01:00
libretro: Link FFmpeg as a static library of its own
With its objects on it, the MSVC link command line got too long for Windows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b0d2f8c92b
commit
03ac2c8ded
1 file changed
+19
-4
+19
-4
@@ -417,7 +417,15 @@ ifeq ($(BUILD_FFMPEG), 1)
|
||||
else
|
||||
FFMPEG_CFLAGS_LAST := -w -Werror=implicit-function-declaration
|
||||
endif
|
||||
OBJECTS += $(FFMPEG_OBJECTS)
|
||||
# Linked as a library of its own, since with all these objects the link command line gets too
|
||||
# long for Windows.
|
||||
ifeq ($(STATIC_LINKING), 1)
|
||||
OBJECTS += $(FFMPEG_OBJECTS)
|
||||
else ifneq (,$(findstring msvc,$(platform)))
|
||||
FFMPEG_LIB := $(FFMPEG_OBJDIR)/ffmpeg.lib
|
||||
else
|
||||
FFMPEG_LIB := $(FFMPEG_OBJDIR)/libffmpeg.a
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
@@ -493,18 +501,25 @@ $(FFMPEG_OBJDIR)/%.o: $(FFMPEGDIR)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(FFMPEG_CFLAGS) $(CFLAGS) $(FFMPEG_CFLAGS_LAST) -c $(OBJOUT)$@ $<
|
||||
|
||||
$(FFMPEG_OBJDIR)/ffmpeg.lib: $(FFMPEG_OBJECTS)
|
||||
lib.exe -nologo -out:$@ $^
|
||||
|
||||
$(FFMPEG_OBJDIR)/libffmpeg.a: $(FFMPEG_OBJECTS)
|
||||
rm -f $@
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(TARGET): $(OBJECTS) $(FFMPEG_LIB)
|
||||
ifeq ($(STATIC_LINKING), 1)
|
||||
$(AR) rcs $(TARGET) $(OBJECTS)
|
||||
else
|
||||
$(LD) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(GL_LIB)
|
||||
$(LD) $(LINKOUT)$@ $(OBJECTS) $(FFMPEG_LIB) $(LDFLAGS) $(GL_LIB)
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f $(filter-out $(CORE_DIR)/ext/zstd/lib/decompress/huf_decompress_amd64.S,$(OBJECTS)) $(TARGET)
|
||||
rm -f $(filter-out $(CORE_DIR)/ext/zstd/lib/decompress/huf_decompress_amd64.S,$(OBJECTS)) $(FFMPEG_OBJECTS) $(FFMPEG_LIB) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
|
||||
Reference in new issue
Block a user