mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-27 20:36:31 -04:00
Switch xcode support to module map approach
This commit is contained in:
@@ -2,3 +2,4 @@
|
|||||||
/cmutton.h
|
/cmutton.h
|
||||||
/testc
|
/testc
|
||||||
/a.out
|
/a.out
|
||||||
|
/xcode/build
|
||||||
|
|||||||
Regular → Executable
+7
-9
@@ -1,9 +1,14 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# TODO Support iOS simulator
|
# TODO Support iOS simulator
|
||||||
|
|
||||||
# setup build dirs
|
# setup working dirs w/modulemap
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
mkdir -p ./build/{ios,macos}
|
mkdir -p ./build/{ios,macos}
|
||||||
|
echo "module cmutton {
|
||||||
|
header "cmutton.h"
|
||||||
|
link "cmutton"
|
||||||
|
export *
|
||||||
|
}" > ./build/{ios,macos}/module.modulemap
|
||||||
|
|
||||||
# cd to Go source
|
# cd to Go source
|
||||||
cd ..
|
cd ..
|
||||||
@@ -18,11 +23,4 @@ CGO_ENABLED=1 GOOS=darwin go build -buildmode=c-archive
|
|||||||
mv ./{cmutton.a,cmutton.h} ./xcode/build/macos/
|
mv ./{cmutton.a,cmutton.h} ./xcode/build/macos/
|
||||||
cp ./types.h ./xcode/build/macos/
|
cp ./types.h ./xcode/build/macos/
|
||||||
|
|
||||||
# cd to xcode build dir and build XCFramework
|
cd ./xcode
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user