Comments (4)
Hi @Mariownyou, Go doesn't build an .app
file but you can create it yourself.
You can try building the program statically so all dependencies is contained using:
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags static -ldflags "-s -w" -o app
After that you can create the following directory structore for the app bundle. Here the name is GoSDL2.app
as example.
GoSDL2.app
└── Contents
├── Info.plist
├── MacOS
│ └── app
└── Resources
├── app.icns
└── example.bmp
The content of Info.plist
is the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>app</string>
<key>CFBundleIconFile</key>
<string>app</string>
</dict>
</plist>
Then you can copy the executable app
to GoSDL2.app/Content/MacOS/
and if you have any resource like image files, you can put them under GoSDL2.app/Content/Resources/
.
As for hiding terminal when building, could you elaborate more on that? Is that a problem somehow?
from go-sdl2.
Thank you for providing information regarding creating .app bundle.
About terminal issue, I would like to hide terminal when builing app
from go-sdl2.
HI @Mariownyou, do you mean that you want to hide terminal when running the app instead of building the app? I think you could create the app bundle like above and run it. In that case it won't show the Terminal
from go-sdl2.
Thanks, I will try this :)
from go-sdl2.
Related Issues (20)
- SDL/SDL.h: No such file or directory HOT 2
- How to ship release version HOT 4
- Surface panics on color conversions due to nonidiomatic color models HOT 4
- Windows release crashing likely because C.CString deallocated with C.SDL_free HOT 3
- Getting an errror when compiling to wasm HOT 2
- impossible type switch case: sdl.QuitEvent HOT 4
- Cannot find -lsdl2 HOT 10
- SDL_AudioStreamAvailable not correctly wrapped HOT 2
- Missing functions in gamecontroller.go HOT 6
- Readme Example Fix typo HOT 2
- Running readme example yields 30% CPU usage HOT 13
- Fails to link with musl libc HOT 1
- feature req: img.LoadSizedSVG HOT 2
- SdlSetTextureScaleMode HOT 7
- Window Doesn't Show HOT 9
- How to SDL on 64bit Windows Instructions Unclear HOT 1
- (suggestion) Convert sdl.Rect Fields from int32 to int HOT 4
- pkg-config issue with sdl2_gfx 0.4.35->0.4.39 HOT 2
- Typo in function name IMG_LoadSizedSVG_RW (IMG_... prefix instead of SDL_...) HOT 2
- KeyboardEvent.Repeat never set HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sdl2.