Fix and clen up macOS build

This commit is contained in:
Anders Jenbo 2021-12-06 15:48:31 +01:00
commit 10c5cbab9f
5 changed files with 12 additions and 15 deletions

View file

@ -31,24 +31,21 @@ jobs:
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-cmake-${{ github.sha }}
restore-keys: ${{ runner.os }}-cmake-
key: macos-cmake-${{ github.sha }}
restore-keys: macos-cmake-
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake ..
working-directory: ${{github.workspace}}
run: cmake -S. -Bbuild
- name: Build
working-directory: ${{github.workspace}}/build
working-directory: ${{github.workspace}}
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . -j $(nproc) --target package
run: cmake --build build -j $(sysctl -n hw.physicalcpu) --target package
- name: Release
uses: softprops/action-gh-release@v1

View file

@ -664,9 +664,9 @@ else()
WIN32
MACOSX_BUNDLE
Source/main.cpp
Source/devilutionx.exe.manifest
Packaging/macOS/AppIcon.icns
Packaging/windows/devilutionx.rc)
Packaging/windows/devilutionx.exe.manifest
Packaging/windows/devilutionx.rc
Packaging/apple/AppIcon.icns)
endif()
target_link_libraries(${BIN_TARGET} PRIVATE libdevilutionx)
@ -1154,7 +1154,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
endif()
if(APPLE)
set_source_files_properties("./Packaging/macOS/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties("./Packaging/apple/AppIcon.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(MACOSX_BUNDLE_GUI_IDENTIFIER com.diasurgical.devilutionx)
set(MACOSX_BUNDLE_COPYRIGHT Unlicense)
set(MACOSX_BUNDLE_BUNDLE_NAME devilutionx)
@ -1163,8 +1163,8 @@ if(APPLE)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION}")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/macOS/Info.plist")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist")
install (TARGETS ${BIN_TARGET} DESTINATION ./)