Update tdlib_ping workflow and README to enhance CGO_CFLAGS configuration for building TDLib. Clarify the inclusion of the build directory in the CFLAGS to improve user experience when compiling from source.
This commit is contained in:
@@ -71,8 +71,8 @@ jobs:
|
||||
fi
|
||||
cd "${ROOT}"
|
||||
export CGO_ENABLED=1
|
||||
# Корень клона td-src: там лежит td/telegram/td_json_client.h для #include <td/telegram/...>
|
||||
export CGO_CFLAGS="-I${TDLIB_ROOT}"
|
||||
# Исходники: td/telegram/td_json_client.h; сгенерированные заголовки (tdjson_export.h): build/td/telegram/
|
||||
export CGO_CFLAGS="-I${TDLIB_ROOT} -I${TDLIB_ROOT}/build"
|
||||
export CGO_LDFLAGS="-L${DIST} -Wl,-rpath,\$ORIGIN -ltdjson"
|
||||
go build -tags=tdlib -trimpath -ldflags="-s -w" -o "${DIST}/${ASSET_BIN}" ./cmd/tdlib_ping
|
||||
chmod +x "${DIST}/${ASSET_BIN}"
|
||||
|
||||
@@ -36,7 +36,8 @@ go build -tags=tdlib -o tdlib_ping ./cmd/tdlib_ping
|
||||
|
||||
```bash
|
||||
export CGO_ENABLED=1
|
||||
export CGO_CFLAGS="-I/path/to/td-clone"
|
||||
# Корень клона + каталог cmake build (там tdjson_export.h после target tdjson).
|
||||
export CGO_CFLAGS="-I/path/to/td-clone -I/path/to/td-clone/build"
|
||||
export CGO_LDFLAGS="-L/path/to/td-clone/build -ltdjson"
|
||||
go build -tags=tdlib -o tdlib_ping ./cmd/tdlib_ping
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user