Skip to content

Commit

Permalink
Improve CMakeLists comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Aug 7, 2024
1 parent 81dc2e2 commit d4cad85
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CMake/TdSetUpCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# - Configures C++14 compiler, setting TDLib-specific compilation options.
# Configures C++14 compiler, setting TDLib-specific compilation options.

function(td_set_up_compiler)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1 PARENT_SCOPE)
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if (POLICY CMP0069)
endif()
endif()

# Configure CCache if available
# Configure Ccache if available
find_program(CCACHE_FOUND ccache)
#set(CCACHE_FOUND 0)
if (CCACHE_FOUND)
Expand Down Expand Up @@ -221,7 +221,7 @@ if (HAS_PARENT)
endif()


#SOURCE SETS
# SOURCE SETS

set_source_files_properties(${TL_TD_API_AUTO_SOURCE} PROPERTIES GENERATED TRUE)
if (TD_ENABLE_JNI OR ANDROID)
Expand Down Expand Up @@ -1057,7 +1057,7 @@ set(MEMPROF_STAT_SOURCE
memprof/memprof_stat.h
)

#LIBRARIES
# LIBRARIES

# memprof - simple library for memory usage profiling
add_library(memprof STATIC ${MEMPROF_SOURCE})
Expand Down Expand Up @@ -1111,7 +1111,7 @@ if (NOT CMAKE_CROSSCOMPILING)
add_dependencies(tdmtproto tl_generate_mtproto)
endif()

# tdcore - mostly internal TDLib interface. One should use tdactor for interactions with it.
# tdcore - internal TDLib interface
if (MSVC AND TD_ENABLE_LTO)
add_library(tdcore_part1 STATIC ${TDLIB_SOURCE_PART1})
target_include_directories(tdcore_part1 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${TL_TD_AUTO_INCLUDE_DIR}>)
Expand Down Expand Up @@ -1174,7 +1174,7 @@ if (TD_ENABLE_DOTNET)
endif()
endif()

# tdc - TDLib interface in pure c.
# tdc - TDLib interface in pure C
add_library(tdc STATIC EXCLUDE_FROM_ALL ${TL_C_SCHEME_SOURCE} td/telegram/td_c_client.cpp td/telegram/td_c_client.h)
target_include_directories(tdc PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down Expand Up @@ -1218,14 +1218,14 @@ target_include_directories(tdjson_static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)

# EXECUTABLES
if (EMSCRIPTEN)
set(TD_EMSCRIPTEN_SRC td/telegram/td_emscripten.cpp)
add_executable(${TD_EMSCRIPTEN} ${TD_EMSCRIPTEN_SRC})
target_include_directories(${TD_EMSCRIPTEN} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(${TD_EMSCRIPTEN} PRIVATE tdjson_static tdactor)
endif()

#EXECUTABLES
if (NOT CMAKE_CROSSCOMPILING)
add_executable(tg_cli td/telegram/cli.cpp ${TL_TD_JSON_SOURCE})

Expand Down Expand Up @@ -1256,7 +1256,7 @@ if (NOT CMAKE_CROSSCOMPILING)
add_dependencies(tg_cli tl_generate_json)
endif()

#Exported libraries
# Exported libraries
add_library(TdStatic INTERFACE)
target_link_libraries(TdStatic INTERFACE tdclient)

Expand Down
2 changes: 1 addition & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (NOT OPENSSL_FOUND)
find_package(ZLIB REQUIRED)
endif()

#TODO: all benchmarks in one file
# TODO: all benchmarks in one file
add_executable(bench_crypto bench_crypto.cpp)
target_link_libraries(bench_crypto PRIVATE tdutils ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES})
if (WIN32)
Expand Down
5 changes: 0 additions & 5 deletions tdactor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()

#SOURCE SETS
set(TDACTOR_SOURCE
td/actor/ConcurrentScheduler.cpp
td/actor/impl/Scheduler.cpp
Expand Down Expand Up @@ -43,10 +42,6 @@ set(TDACTOR_TEST_SOURCE
PARENT_SCOPE
)

#RULES

#LIBRARIES

add_library(tdactor STATIC ${TDACTOR_SOURCE})
target_include_directories(tdactor PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(tdactor PUBLIC tdutils)
Expand Down
1 change: 0 additions & 1 deletion tddb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()

#SOURCE SETS
set(TDDB_SOURCE
td/db/binlog/Binlog.cpp
td/db/binlog/BinlogEvent.cpp
Expand Down
4 changes: 0 additions & 4 deletions tdnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if (NOT OPENSSL_FOUND)
find_package(ZLIB REQUIRED)
endif()

#SOURCE SETS
set(TDNET_SOURCE
td/net/GetHostByNameActor.cpp
td/net/HttpChunkedByteFlow.cpp
Expand Down Expand Up @@ -59,9 +58,6 @@ if (APPLE_WATCH)
set_source_files_properties(td/net/DarwinHttp.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
endif()

#RULES
#LIBRARIES

add_library(tdnet STATIC ${TDNET_SOURCE})
target_include_directories(tdnet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(tdnet SYSTEM PRIVATE $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
Expand Down
3 changes: 0 additions & 3 deletions tdtl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2"))
message(FATAL_ERROR "CMake >= 3.0.2 is required")
endif()

#SOURCE SETS
set(TDTL_SOURCE
td/tl/tl_config.cpp
td/tl/tl_core.cpp
Expand All @@ -27,5 +26,3 @@ set(TDTL_SOURCE

add_library(tdtl STATIC ${TDTL_SOURCE})
target_include_directories(tdtl PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
#TODO
#target_compile_options(tdtl PRIVATE "-std=c++03")
2 changes: 0 additions & 2 deletions tdutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ configure_file(td/utils/config.h.in td/utils/config.h @ONLY)

add_subdirectory(generate)

# TDUTILS
set_source_files_properties(${TDMIME_AUTO} PROPERTIES GENERATED TRUE)
if (CLANG OR GCC)
set_property(SOURCE ${TDMIME_AUTO} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-conversion")
Expand Down Expand Up @@ -349,7 +348,6 @@ set(TDUTILS_TEST_SOURCE
PARENT_SCOPE
)

#LIBRARIES
add_library(tdutils STATIC ${TDUTILS_SOURCE})

if (NOT CMAKE_CROSSCOMPILING AND TDUTILS_MIME_TYPE)
Expand Down
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ if ((CMAKE_MAJOR_VERSION LESS 3) OR (CMAKE_VERSION VERSION_LESS "3.0.2"))
message(FATAL_ERROR "CMake >= 3.0.2 is required")
endif()

#SOURCE SETS
set(TD_TEST_SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/country_info.cpp
${CMAKE_CURRENT_SOURCE_DIR}/db.cpp
Expand Down Expand Up @@ -36,7 +35,6 @@ set(TESTS_MAIN
#target_link_libraries(all_tests PRIVATE tdcore tdclient)

if (NOT CMAKE_CROSSCOMPILING OR EMSCRIPTEN)
#Tests
if (OPENSSL_FOUND)
add_executable(test-crypto EXCLUDE_FROM_ALL crypto.cpp)
target_include_directories(test-crypto SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR})
Expand Down

0 comments on commit d4cad85

Please sign in to comment.