mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-28 12:56:33 -04:00
Switch xcode support to module map approach
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env zsh
|
||||
# TODO Support iOS simulator
|
||||
|
||||
# setup working dirs w/modulemap
|
||||
rm -rf ./build
|
||||
mkdir -p ./build/{ios,macos}
|
||||
echo "module cmutton {
|
||||
header "cmutton.h"
|
||||
link "cmutton"
|
||||
export *
|
||||
}" > ./build/{ios,macos}/module.modulemap
|
||||
|
||||
# cd to Go source
|
||||
cd ..
|
||||
|
||||
# build static archive for all platforms
|
||||
## iOS
|
||||
CGO_ENABLED=1 GOOS=ios SDK=iphoneos go build -buildmode=c-archive
|
||||
mv ./{cmutton.a,cmutton.h} ./xcode/build/ios/
|
||||
cp ./types.h ./xcode/build/ios/
|
||||
## macOS
|
||||
CGO_ENABLED=1 GOOS=darwin go build -buildmode=c-archive
|
||||
mv ./{cmutton.a,cmutton.h} ./xcode/build/macos/
|
||||
cp ./types.h ./xcode/build/macos/
|
||||
|
||||
cd ./xcode
|
||||
Reference in New Issue
Block a user