From dd0fd9397062ef64dcb6a0990d4d1c156335f81b Mon Sep 17 00:00:00 2001 From: Arman Date: Sat, 5 Jun 2021 02:02:29 +0430 Subject: [PATCH] Add go modules, link against libc++ instead of stdc++ --- go.mod | 3 +++ tdlib.go | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ed59b81 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/Arman92/go-tdlib + +go 1.15 diff --git a/tdlib.go b/tdlib.go index f9034d2..b5936e1 100644 --- a/tdlib.go +++ b/tdlib.go @@ -3,8 +3,8 @@ package tdlib //#cgo linux CFLAGS: -I/usr/local/include //#cgo darwin CFLAGS: -I/usr/local/include //#cgo windows CFLAGS: -IC:/src/td -IC:/src/td/build -//#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm -//#cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm +//#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lc++ -lssl -lcrypto -ldl -lz -lm +//#cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lc++ -lssl -lcrypto -ldl -lz -lm //#cgo windows LDFLAGS: -LC:/src/td/build/Debug -ltdjson //#include //#include @@ -214,8 +214,8 @@ func SetFilePath(path string) { bytes, _ := json.Marshal(UpdateData{ "@type": "setLogStream", "log_stream": UpdateData{ - "@type": "logStreamFile", - "path": path, + "@type": "logStreamFile", + "path": path, "max_file_size": 10485760, }, }) @@ -229,7 +229,7 @@ func SetFilePath(path string) { // By default the TDLib uses a verbosity level of 5 for logging. func SetLogVerbosityLevel(level int) { bytes, _ := json.Marshal(UpdateData{ - "@type": "setLogVerbosityLevel", + "@type": "setLogVerbosityLevel", "new_verbosity_level": level, })