Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 13169200C36 for ; Thu, 23 Feb 2017 23:43:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 11CE1160B64; Thu, 23 Feb 2017 22:43:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 36B6B160B3E for ; Thu, 23 Feb 2017 23:43:15 +0100 (CET) Received: (qmail 51228 invoked by uid 500); 23 Feb 2017 22:43:14 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 51208 invoked by uid 99); 23 Feb 2017 22:43:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 22:43:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 152C8DFF08; Thu, 23 Feb 2017 22:43:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aconway@apache.org To: commits@qpid.apache.org Date: Thu, 23 Feb 2017 22:43:14 -0000 Message-Id: <70870c455472460c93cde8aa05863abc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] qpid-proton git commit: Revert "NO-JIRA: go binding build results in binary dir, not source dir" archived-at: Thu, 23 Feb 2017 22:43:16 -0000 Repository: qpid-proton Updated Branches: refs/heads/master 204c8474d -> c94301d59 Revert "NO-JIRA: go binding build results in binary dir, not source dir" This reverts commit 9bd99ebf096ed83bd23ae05fe9cc0e6f65d9ac2e. Copying sources into the bin dir for compliation is a bad idea: - compile errors are located in the binary copy, not the source - deleted source files are not reflected in the binary copy Need a better solution. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/5d1c2479 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5d1c2479 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5d1c2479 Branch: refs/heads/master Commit: 5d1c24796a0411e659e082e81171cde511b04f02 Parents: 204c847 Author: Alan Conway Authored: Thu Feb 23 09:05:39 2017 -0500 Committer: Alan Conway Committed: Thu Feb 23 13:46:57 2017 -0500 ---------------------------------------------------------------------- .gitignore | 7 +++++++ examples/go/CMakeLists.txt | 8 +++++--- proton-c/bindings/go/CMakeLists.txt | 17 +++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5d1c2479/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index b769990..aa9bc36 100644 --- a/.gitignore +++ b/.gitignore @@ -31,9 +31,16 @@ eclipse-classes # The usual location for proton-c build files proton-c/build +# Executables built by go binding tests +proton-c/bindings/go/bin + # Testresults from the jenkins build script testresults +# Go binding build output +/proton-c/bindings/go/pkg +/proton-c/bindings/go/bin + # Python TOX test build output /proton-c/bindings/python/MANIFEST /proton-c/bindings/python/build http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5d1c2479/examples/go/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/go/CMakeLists.txt b/examples/go/CMakeLists.txt index 861cdd8..c9aba01 100644 --- a/examples/go/CMakeLists.txt +++ b/examples/go/CMakeLists.txt @@ -20,11 +20,12 @@ if(BUILD_GO) set(examples electron/broker electron/receive electron/send proton/broker) + file(GLOB_RECURSE example_source FOLLOW_SYMLINKS ${CMAKE_CURRENT_SOURCE_DIR}/*.go) # Build example exes foreach(example ${examples}) - string(REPLACE / - target ${example}) - set(target "go-example-${target}") + string(REPLACE / _ target ${example}) + set(target "go_example_${target}") set(output ${CMAKE_CURRENT_BINARY_DIR}/${example}) # Always run go_build, it will do nothing if there is nothing to do. # Otherwise it's too hard to get the dependencies right. @@ -32,11 +33,12 @@ if(BUILD_GO) COMMAND ${GO_BUILD} ${GO_EXAMPLE_FLAGS} -o ${output} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.go WORKING_DIRECTORY ${CMAKE_BINARY_DIR} DEPENDS go-build) + list(APPEND example_targets ${target}) endforeach() # Build test driver exe set(test_exe ${CMAKE_CURRENT_BINARY_DIR}/example_test) - add_custom_target(go-example-test ALL + add_custom_target(go_example_test ALL COMMAND ${GO_TEST} -c -o ${test_exe} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.go WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5d1c2479/proton-c/bindings/go/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/go/CMakeLists.txt b/proton-c/bindings/go/CMakeLists.txt index 1cb9d6c..d0ffe9b 100644 --- a/proton-c/bindings/go/CMakeLists.txt +++ b/proton-c/bindings/go/CMakeLists.txt @@ -26,6 +26,7 @@ set(GO_TEST_FLAGS "-v" CACHE STRING "Flags for 'go test'") # Flags that differ for golang go and gcc go. if (go_ver MATCHES "gccgo") + # TODO aconway 2015-10-08: import cycles with -race under gccgo, investigate. set(GO_RPATH_FLAGS -gccgoflags "-Wl,-rpath=${CMAKE_BINARY_DIR}/proton-c") else() set(GO_RPATH_FLAGS -ldflags "-r ${CMAKE_BINARY_DIR}/proton-c") @@ -36,7 +37,7 @@ separate_arguments(GO_TEST_FLAGS) # Following are CACHE INTERNAL so examples/CMakeLists.txt can see them. set(GO_ENV ${env_py} -- - "GOPATH=${CMAKE_CURRENT_BINARY_DIR}" + "GOPATH=${CMAKE_CURRENT_SOURCE_DIR}" "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" @@ -46,15 +47,15 @@ set(GO ${GO_ENV} ${GO_EXE} CACHE INTERNAL "Run go with environment set") set(GO_BUILD ${GO} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go build") set(GO_INSTALL ${GO} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install" ) -set(GO_TEST ${GO} test ${GO_TEST_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go test") +set(GO_TEST ${GO} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL "Run go test") -# 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. -# -# The Go sources are copied to the binary directory so we can respect the standard Go tree -# layout without polluting the source tree. +# 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. add_custom_target(go-build ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src COMMAND ${GO_INSTALL} qpid.apache.org/... DEPENDS qpid-proton-core WORKING_DIRECTORY $ENV{PWD}) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org