2
0
mirror of synced 2025-02-22 14:28:14 +00:00
mobile/bind/objc/test.bash
Hyang-Ah (Hana) Kim 9c7482eec9 bind/objc: use gobind -lang=objc,go to generate code.
Removed checked-in version of go, objective-c proxy code.

Change-Id: Iac2c6ba3156def680746b5ae1fe02d6e712532a7
Reviewed-on: https://go-review.googlesource.com/10842
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-10 00:17:26 +00:00

33 lines
861 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)
# TODO: package seq.h Testpkg.* and gooutput.a into a statically linked framework.
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