Skip to content

Commit

Permalink
Don't require breakpad/ffmpeg build directories on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Apr 17, 2022
1 parent ed1411f commit 8ca7ff8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 deletions.
17 changes: 13 additions & 4 deletions external/crash_reports/breakpad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
add_library(external_breakpad INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_breakpad ALIAS external_breakpad)

target_include_directories(external_breakpad SYSTEM
INTERFACE
${libs_loc}/breakpad/src
)
if (LINUX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(BREAKPAD REQUIRED breakpad)
target_include_directories(external_breakpad SYSTEM
INTERFACE
${BREAKPAD_INCLUDE_DIRS}
)
else()
target_include_directories(external_breakpad SYSTEM
INTERFACE
${libs_loc}/breakpad/src
)
endif()

if (build_win64)
set(breakpad_config_add _x64)
Expand Down
36 changes: 26 additions & 10 deletions external/ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,41 @@ if (DESKTOP_APP_USE_PACKAGED)
PkgConfig::SWRESAMPLE
)
else()
target_include_directories(external_ffmpeg SYSTEM
INTERFACE
${libs_loc}/ffmpeg
)
if (LINUX)
target_link_static_libraries(external_ffmpeg
INTERFACE
avformat
avcodec
swresample
swscale
avutil
)
else()
set(ffmpeg_lib_loc ${libs_loc}/ffmpeg)

set(ffmpeg_lib_loc ${libs_loc}/ffmpeg)
target_include_directories(external_ffmpeg SYSTEM
INTERFACE
${ffmpeg_lib_loc}
)

target_link_libraries(external_ffmpeg
INTERFACE
${ffmpeg_lib_loc}/libavformat/libavformat.a
${ffmpeg_lib_loc}/libavcodec/libavcodec.a
${ffmpeg_lib_loc}/libswresample/libswresample.a
${ffmpeg_lib_loc}/libswscale/libswscale.a
${ffmpeg_lib_loc}/libavutil/libavutil.a
)
endif()

target_link_libraries(external_ffmpeg
INTERFACE
${ffmpeg_lib_loc}/libavformat/libavformat.a
${ffmpeg_lib_loc}/libavcodec/libavcodec.a
${ffmpeg_lib_loc}/libswresample/libswresample.a
${ffmpeg_lib_loc}/libswscale/libswscale.a
${ffmpeg_lib_loc}/libavutil/libavutil.a
$<LINK_ONLY:desktop-app::external_opus>
$<TARGET_FILE:desktop-app::external_opus>
$<LINK_ONLY:desktop-app::external_vpx>
$<TARGET_FILE:desktop-app::external_vpx>
)

if (APPLE)
target_link_libraries(external_ffmpeg INTERFACE bz2)
elseif (LINUX)
Expand Down

0 comments on commit 8ca7ff8

Please sign in to comment.