Skip to content

Commit

Permalink
chore: create MACOSX_BUNDLE
Browse files Browse the repository at this point in the history
this results in a GUI instead of a CMD application on macOS
  • Loading branch information
codeflorist committed Nov 20, 2024
1 parent c90bf56 commit 4ea28c6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/macos-x86-64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
run: ./scripts/bundle-libs-macos.sh

- name: Copy OS specific files
run: cp -r ./dist-os-specific/macos/* ./dist
run: cp -rf ./dist-os-specific/macos/* ./dist

- name: Test executable
run: |
brew uninstall --force --ignore-dependencies argtable sdl2 dumb libogg flac libpng freetype libvorbis ca-certificates openssl@3 opus opusfile physfs theora giflib jpeg-turbo xz lz4 zstd libtiff webp pcre2 gettext glib lame mpg123 libsndfile portaudio readline allegro fluid-synth mad enet
cd dist
cd dist/dunedynasty.app/Contents/MacOS
./dunedynasty | grep "data directory"
- name: Zip dist folder
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ configure_file("${CMAKE_SOURCE_DIR}/include/buildcfg.h.in" "${PROJECT_BINARY_DIR
include(cmake/FileList.cmake)
include_directories("include" "${PROJECT_BINARY_DIR}/include")

add_executable(dunedynasty WIN32
add_executable(dunedynasty WIN32 MACOSX_BUNDLE
${DUNEDYNASTY_SRC_FILES} ${CMAKE_SOURCE_DIR}/src/icon/icon.rc)

target_link_libraries(dunedynasty
Expand Down
36 changes: 36 additions & 0 deletions dist-os-specific/macos/dunedynasty.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>dunedynasty</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<key>CFBundleName</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>LSMinimumSystemVersion</key>
<string>10</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion scripts/bundle-libs-macos.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash -e
dylibbundler -od -cd -x ./dist/dunedynasty -b -d ./dist/libs -p @executable_path/libs/
dylibbundler -od -cd -x ./dist/dunedynasty.app/Contents/MacOS/dunedynasty -b -d ./dist/dunedynasty.app/Contents/MacOS/libs -p @executable_path/libs/

0 comments on commit 4ea28c6

Please sign in to comment.