Skip to content

Commit

Permalink
Allow to link against static TDJSON library
Browse files Browse the repository at this point in the history
  • Loading branch information
EricKotato committed Dec 4, 2020
1 parent 033d4c9 commit 2c8d10f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Omit `-A Win32` to use your default system architecture.

Omit any of `-DTD_DIR` and `-DSCITER_INCLUDE_DIR` (or all) to search packages in default paths.

You can also add `-DUSE_STATIC_TDJSON=ON` to `cmake` arguments if you want it to link extension against static library instead of dynamic.


Build (starting from C:\TDLibNSE\build):
```
Expand Down
8 changes: 7 additions & 1 deletion TDLibNSE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ add_definitions(-DUNICODE -D_UNICODE)
find_package(Td 1.7.0 REQUIRED)
find_path(SCITER_INCLUDE_DIR NAMES sciter-x.h REQUIRED)

option(USE_STATIC_TDJSON "Link extension with static library instead of dynamic one" OFF)

add_library(TDLibNSE SHARED tdlib_nse.cpp)
target_include_directories(TDLibNSE PUBLIC ${SCITER_INCLUDE_DIR})

target_link_libraries(TDLibNSE PRIVATE Td::TdJson)
if (USE_STATIC_TDJSON)
target_link_libraries(TDLibNSE PRIVATE Td::TdJsonStatic)
else()
target_link_libraries(TDLibNSE PRIVATE Td::TdJson)
endif()

0 comments on commit 2c8d10f

Please sign in to comment.