Skip to content

Commit

Permalink
MB-44988: Add -buildmode=exe for Windows Go module builds
Browse files Browse the repository at this point in the history
Change-Id: Ia6ae564ae463b76216ffdf28f29365e96e808823
Reviewed-on: http://review.couchbase.org/c/tlm/+/148612
Reviewed-by: Isha Kandaswamy <isha@couchbase.com>
Tested-by: Chris Hillery <ceej@couchbase.com>
  • Loading branch information
ceejatec committed Mar 15, 2021
1 parent 058cdf9 commit 4539947
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/Modules/go-modbuild.cmake
Expand Up @@ -77,14 +77,19 @@ get_filename_component(REPOSYNC "${REPOSYNC}" REALPATH)
SET (GCFLAGS "-trimpath=${REPOSYNC}" ${GCFLAGS})
SET (ASMFLAGS "-trimpath=${REPOSYNC}")

# Work around Windows Go 1.15 link error - MB-44988
IF (WIN32)
SET (_go_buildmode "-buildmode=exe")
ENDIF ()

# Execute "go build".
SET (CMAKE_EXECUTE_PROCESS_COMMAND_ECHO STDOUT)
EXECUTE_PROCESS (
RESULT_VARIABLE _failure
COMMAND "${GOEXE}" build
"-tags=${GOTAGS}" "-gcflags=${GCFLAGS}"
"-asmflags=${ASMFLAGS}" "-ldflags=${LDFLAGS}"
${_go_debug} ${_go_race}
${_go_debug} ${_go_race} ${_go_buildmode}
-mod=readonly
-o "${OUTPUT}"
"${PACKAGE}")
Expand Down

0 comments on commit 4539947

Please sign in to comment.