2
0
mirror of synced 2025-02-22 14:28:14 +00:00
mobile/bind/objc/test.bash
Hyang-Ah (Hana) Kim 50f2c0f60e bind/objc: update test.bash to run gobind.
Change-Id: I38379d6f1a6bbaa13234060b52edc8206b750644
Reviewed-on: https://go-review.googlesource.com/13028
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-05 20:02:56 +00:00

32 lines
778 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2015 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# This is a script to compile and run SeqTest.
set -e
export GOARCH=amd64
export GOOS=darwin # TODO: arm, arm64.
export CGO_ENABLED=1
WORK=`mktemp -d /tmp/objctest.XXXXX`
function cleanup() {
rm -rf ${WORK}
}
trap cleanup EXIT
(cd testpkg; go generate)
go build -x -v -buildmode=c-archive -o=${WORK}/libgo.a test_main.go
cp ./seq.h ${WORK}/
cp testpkg/objc_testpkg/GoTestpkg.* ${WORK}/
cp ./SeqTest.m ${WORK}/
ccargs="-Wl,-no_pie -framework Foundation -fobjc-arc"
$(go env CC) $(go env GOGCCFLAGS) $ccargs -o ${WORK}/a.out ${WORK}/libgo.a ${WORK}/GoTestpkg.m ${WORK}/SeqTest.m
${WORK}/a.out