Commit 72234fcd authored by Linshizhi's avatar Linshizhi

Control static or shared via BUILD_SHARED_LIBS

parent 027b6b8f
...@@ -5,8 +5,9 @@ include(ExternalProject) ...@@ -5,8 +5,9 @@ include(ExternalProject)
project(FFmpeg_Protos) project(FFmpeg_Protos)
option(DEBUG "Only enable during development" OFF) option(DEBUG "Only enable during development" OFF)
option(STATICLIB "Generate Static Library" OFF)
option(EMCC "Run in WASM environment" OFF) option(EMCC "Run in WASM environment" OFF)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
set(LIB ${CMAKE_SOURCE_DIR}/lib) set(LIB ${CMAKE_SOURCE_DIR}/lib)
......
...@@ -23,15 +23,15 @@ ExternalProject_Add( ...@@ -23,15 +23,15 @@ ExternalProject_Add(
INSTALL_COMMAND make install INSTALL_COMMAND make install
UPDATE_COMMAND "" UPDATE_COMMAND ""
) )
endif()
add_library(protos ${SRCs})
add_library(protos SHARED ${SRCs}) if (NOT EMCC)
target_link_libraries(protos target_link_libraries(protos
avformat avcodec avdevice avfilter avutil avformat avcodec avdevice avfilter avutil
swresample swscale postproc z x264 lzma) swresample swscale postproc z x264 lzma)
target_include_directories(protos PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(protos PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_library(protos STATIC ${SRCs})
endif() endif()
install(TARGETS protos install(TARGETS protos
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment