Coder Social home page Coder Social logo

Comments (4)

veeableful avatar veeableful commented on August 17, 2024

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.

Mariownyou avatar Mariownyou commented on August 17, 2024

Thank you for providing information regarding creating .app bundle.

About terminal issue, I would like to hide terminal when builing app
image

from go-sdl2.

veeableful avatar veeableful commented on August 17, 2024

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.

Mariownyou avatar Mariownyou commented on August 17, 2024

Thanks, I will try this :)

from go-sdl2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.