Skip to content

Commit

Permalink
include cmake rules for third party libraries only if it needed
Browse files Browse the repository at this point in the history
  • Loading branch information
vitlav authored and noiseless committed Dec 29, 2021
1 parent b6e101f commit 5986975
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ include(cmake/init_target.cmake)
include(cmake/generate_target.cmake)
include(cmake/target_yasm_sources.cmake)
include(cmake/external.cmake)
include(cmake/libabsl.cmake)
include(cmake/libopenh264.cmake)
include(cmake/libpffft.cmake)
include(cmake/librnnoise.cmake)
include(cmake/libsrtp.cmake)
include(cmake/libusrsctp.cmake)
include(cmake/libvpx.cmake)
include(cmake/libyuv.cmake)
if (APPLE)
include(cmake/libsdkmacos.cmake)
Expand Down
12 changes: 12 additions & 0 deletions cmake/external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ function(link_libabsl target_name)
endif()
endif()
if (NOT absl_FOUND)
if (NOT TARGET libabsl)
include(cmake/libabsl.cmake)
endif()
target_link_libraries(${target_name} PRIVATE tg_owt::libabsl)
endif()
endfunction()
Expand All @@ -139,6 +142,9 @@ function(link_libopenh264 target_name)
endif()
endif()
if (NOT LIBOPENH264_FOUND)
if (NOT TARGET libopenh264)
include(cmake/libopenh264.cmake)
endif()
target_link_libraries(${target_name} PRIVATE tg_owt::libopenh264)
target_include_directories(${target_name} PRIVATE ${libopenh264_loc}/include)
endif()
Expand All @@ -156,6 +162,9 @@ function(link_libusrsctp target_name)
endif()
endif()
if (NOT LIBUSRSCTP_FOUND)
if (NOT TARGET libusrsctp)
include(cmake/libusrsctp.cmake)
endif()
target_link_libraries(${target_name} PRIVATE tg_owt::libusrsctp)
endif()
endfunction()
Expand All @@ -172,6 +181,9 @@ function(link_libvpx target_name)
endif()
endif()
if (NOT LIBVPX_FOUND)
if (NOT TARGET libvpx)
include(cmake/libvpx.cmake)
endif()
target_link_libraries(${target_name} PRIVATE tg_owt::libvpx)
if (is_x86 OR is_x64)
target_link_libraries(${target_name}
Expand Down

0 comments on commit 5986975

Please sign in to comment.