diff --git a/.gitignore b/.gitignore index 5a2e5b9..8821164 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /cmutton.h /testc /a.out +/xcode/build diff --git a/xcode/genXCFramework.zsh b/xcode/genXCModule.zsh old mode 100644 new mode 100755 similarity index 62% rename from xcode/genXCFramework.zsh rename to xcode/genXCModule.zsh index 66a3a57..4679de0 --- a/xcode/genXCFramework.zsh +++ b/xcode/genXCModule.zsh @@ -1,9 +1,14 @@ #!/usr/bin/env zsh # TODO Support iOS simulator -# setup build dirs +# 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 .. @@ -18,11 +23,4 @@ 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 to xcode build dir and build XCFramework -cd ./xcode/build -xcodebuild -create-framework \ - -library ./ios/cmutton.a \ - -headers ./ios/cmutton.h \ - -library ./macos/cmutton.a \ - -headers ./macos/cmutton.h \ - -output cmutton.xcframework +cd ./xcode