Skip to content

Commit

Permalink
Move CMAKE_DL_LIBS to libtgvoip cmake file and add missed pthread
Browse files Browse the repository at this point in the history
Remove unneeded minizip include directory from cmake

Remove unneeded compile definations

Opus is needed only by libtgvoip
  • Loading branch information
ilya-fedin authored and john-preston committed May 5, 2020
1 parent 3135463 commit 27f6c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
14 changes: 0 additions & 14 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ PRIVATE
desktop-app::external_openal
)

if (NOT DESKTOP_APP_USE_PACKAGED)
target_link_libraries(Telegram PRIVATE desktop-app::external_opus)
endif()

# Telegram uses long atomic types, so on some architectures libatomic is needed.
check_cxx_source_compiles("
#include <atomic>
Expand All @@ -146,7 +142,6 @@ if (DESKTOP_APP_USE_PACKAGED)

target_link_libraries(Telegram
PRIVATE
${CMAKE_DL_LIBS}
Threads::Threads
)
endif()
Expand Down Expand Up @@ -1183,21 +1178,12 @@ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Telegram PREFIX Resources FILES ${

target_include_directories(Telegram PRIVATE ${src_loc})

if (NOT DESKTOP_APP_USE_PACKAGED)
target_include_directories(Telegram PRIVATE ${third_party_loc}/minizip)
endif()

target_compile_definitions(Telegram
PRIVATE
TDESKTOP_API_ID=${TDESKTOP_API_ID}
TDESKTOP_API_HASH=${TDESKTOP_API_HASH}
AL_ALEXT_PROTOTYPES
)

if (NOT DESKTOP_APP_USE_PACKAGED)
target_compile_definitions(Telegram PRIVATE AL_LIBTYPE_STATIC)
endif()

if (${CMAKE_GENERATOR} MATCHES "(Visual Studio|Xcode)")
set(output_folder ${CMAKE_BINARY_DIR})
elseif (DESKTOP_APP_SPECIAL_TARGET STREQUAL "")
Expand Down
8 changes: 8 additions & 0 deletions Telegram/cmake/lib_tgvoip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -790,4 +790,12 @@ else()
desktop-app::external_openssl
desktop-app::external_opus
)

if (LINUX)
target_link_libraries(lib_tgvoip
PRIVATE
${CMAKE_DL_LIBS}
pthread
)
endif()
endif()

0 comments on commit 27f6c8c

Please sign in to comment.