Use Go modules for building libsyncthing

Requires Go 1.11 or later
This commit is contained in:
Martchus 2019-07-07 12:11:16 +02:00
parent 2f081bd28b
commit 4cabaf0c4b
2 changed files with 6 additions and 4 deletions

8
.gitignore vendored
View File

@ -1,5 +1,4 @@
# C++ objects and libs # C++ objects and libs
*.slo *.slo
*.lo *.lo
*.o *.o
@ -11,7 +10,6 @@
*.dylib *.dylib
# Qt-es # Qt-es
/.qmake.cache /.qmake.cache
/.qmake.stash /.qmake.stash
*.pro.user *.pro.user
@ -27,13 +25,15 @@ Makefile*
*-build-* *-build-*
# QtCreator # QtCreator
*.autosave *.autosave
#QtCtreator Qml # QtCtreator Qml
*.qmlproject.user *.qmlproject.user
*.qmlproject.user.* *.qmlproject.user.*
# Go modules
/libsyncthing/go/pkg
# Dolphin # Dolphin
.directory .directory

View File

@ -91,6 +91,7 @@ message(STATUS "Syncthing's go files: ${SRC_FILES_SYNCTHING}")
# generate Syncthing's assets: don't set GOARCH/GOOS here, this is supposed to run on the host # generate Syncthing's assets: don't set GOARCH/GOOS here, this is supposed to run on the host
add_custom_command(OUTPUT "${SYNCTHING_PATH}/lib/auto/gui.files.go" add_custom_command(OUTPUT "${SYNCTHING_PATH}/lib/auto/gui.files.go"
COMMAND "GOPATH=${GO_DEVELOPMENT_PATH}" COMMAND "GOPATH=${GO_DEVELOPMENT_PATH}"
"GO111MODULE=on"
"${GO_BIN}" "${GO_BIN}"
run run
./script/genassets.go ./script/genassets.go
@ -110,6 +111,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a"
"GOOS=${GO_TARGET_OS}" "GOOS=${GO_TARGET_OS}"
"GOARCH=${GO_TARGET_ARCH}" "GOARCH=${GO_TARGET_ARCH}"
"CGO_ENABLED=1" "CGO_ENABLED=1"
"GO111MODULE=on"
"GOPATH=${GO_DEVELOPMENT_PATH}" "GOPATH=${GO_DEVELOPMENT_PATH}"
"${GO_BIN}" "${GO_BIN}"
build build