build tag

This commit is contained in:
Aleksandr Zelenin 2018-09-25 22:18:30 +03:00
parent 82b025b53e
commit 7e9b42db25
4 changed files with 34 additions and 8 deletions

11
client/tdjson.go Normal file
View file

@ -0,0 +1,11 @@
// +build !linux
package client
/*
#cgo darwin CFLAGS: -I/usr/local/include
#cgo windows CFLAGS: -IC:/src/td -IC:/src/td/build
#cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm
#cgo windows LDFLAGS: -LC:/src/td/build/Debug -ltdjson
*/
import "C"

9
client/tdjson_dynamic.go Normal file
View file

@ -0,0 +1,9 @@
// +build libtdjson
// +build linux
package client
/*
#cgo linux LDFLAGS: -ltdjson -lstdc++ -lssl -lcrypto -ldl -lz -lm
*/
import "C"

9
client/tdjson_static.go Normal file
View file

@ -0,0 +1,9 @@
// +build !libtdjson
// +build linux
package client
/*
#cgo linux LDFLAGS: -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm
*/
import "C"

View file

@ -1,13 +1,10 @@
package client
// #cgo linux LDFLAGS: -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm
// #cgo darwin CFLAGS: -I/usr/local/include
// #cgo windows CFLAGS: -IC:/src/td -IC:/src/td/build
// #cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm
// #cgo windows LDFLAGS: -LC:/src/td/build/Debug -ltdjson
// #include <stdlib.h>
// #include <td/telegram/td_json_client.h>
// #include <td/telegram/td_log.h>
/*
#include <stdlib.h>
#include <td/telegram/td_json_client.h>
#include <td/telegram/td_log.h>
*/
import "C"
import (