qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject qpid-proton git commit: PROTON-1705: [go] binding puts build artifacts in the source tree
Date Thu, 30 Nov 2017 22:29:44 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master fe9069f9d -> e60e2faeb


PROTON-1705: [go] binding puts build artifacts in the source tree

Build the go binding in the build tree, with a symlink to the sources in the
source tree.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e60e2fae
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e60e2fae
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e60e2fae

Branch: refs/heads/master
Commit: e60e2faebe115c8d992e287bf06a0fec52642f40
Parents: fe9069f
Author: Alan Conway <aconway@redhat.com>
Authored: Thu Nov 30 17:26:39 2017 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Thu Nov 30 17:26:39 2017 -0500

----------------------------------------------------------------------
 proton-c/bindings/go/CMakeLists.txt | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e60e2fae/proton-c/bindings/go/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/go/CMakeLists.txt b/proton-c/bindings/go/CMakeLists.txt
index a15df33..d24ce6a 100644
--- a/proton-c/bindings/go/CMakeLists.txt
+++ b/proton-c/bindings/go/CMakeLists.txt
@@ -37,9 +37,14 @@ endif()
 separate_arguments(GO_BUILD_FLAGS)
 separate_arguments(GO_TEST_FLAGS)
 
+# Create a Go tree in the binary directory, link src to the source directory
+set(GOPATH ${CMAKE_CURRENT_BINARY_DIR})
+add_custom_target(go-src-link ALL
+  COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/src ${GOPATH}/src)
+
 # Following are CACHE INTERNAL so examples/CMakeLists.txt can see them.
 set(GO_ENV ${env_py} --
-  "GOPATH=${CMAKE_CURRENT_SOURCE_DIR}"
+  "GOPATH=${GOPATH}"
   "CGO_CFLAGS=-I${CMAKE_SOURCE_DIR}/proton-c/include -I${CMAKE_BINARY_DIR}/proton-c/include"
   "CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/proton-c"
   "PN_INTEROP_DIR=${CMAKE_SOURCE_DIR}/tests/interop"
@@ -52,9 +57,6 @@ set(GO_BUILD ${GO} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL
"Run
 set(GO_INSTALL ${GO} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install" )
 set(GO_TEST ${GO} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL
"Run go test")
 
-# Go tools insist on standard Go layout which puts compiled code in the source tree :(
-# Build output is all under git-ignored pkg or bin subdirectories, they are removed by make
clean.
-
 # The go build tools handle dependency checks and incremental builds better than
 # CMake so just run them every time, they do nothing if nothing needs to be
 # done.
@@ -67,13 +69,8 @@ add_test(
   NAME go-test COMMAND ${GO_TEST} qpid.apache.org/...
   WORKING_DIRECTORY $ENV{PWD})
 
-# Make available to examples/go/CMakeLists
-set(GO_TARGETS go-build CACHE INTERNAL "Go package library targets")
-
 # Clean up go output directories.
-list(APPEND ADDITIONAL_MAKE_CLEAN_FILES
-  ${CMAKE_CURRENT_SOURCE_DIR}/pkg
-  ${CMAKE_CURRENT_SOURCE_DIR}/bin)
+list(APPEND ADDITIONAL_MAKE_CLEAN_FILES ${GOPATH}/pkg ${GOPATH}/bin)
 
 # Install go sources.
 set (GO_INSTALL_DIR ${SHARE_INSTALL_DIR}/gocode/src CACHE PATH "Installation directory for
Go code")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message