Skip to content

Commit

Permalink
Merge pull request #1428 from CesiumGS/mactastic
Browse files Browse the repository at this point in the history
Fix the macOS / iOS build
  • Loading branch information
csciguy8 authored May 22, 2024
2 parents 3f830c5 + 98d7ba1 commit e06e36b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/actions/install-unreal-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ inputs:
aws-secret-access-key:
required: true
type: string
unreal-program-name:
required: true
type: string
runs:
using: composite
steps:
Expand All @@ -19,9 +22,13 @@ runs:
AWS_SECRET_ACCESS_KEY: ${{ inputs.aws-secret-access-key }}
shell: bash
run: |
df -h
aws s3 cp ${{ inputs.unreal-engine-zip }} ./ue.zip --no-progress
- name: Unzip Unreal Engine
shell: bash
run: |
unzip -q ue.zip -d $HOME
df -h
unzip -q ue.zip "${{ inputs.unreal-program-name }}/Engine/*" -d $HOME -x "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/LiveLinkHub-Mac-Shipping.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/Android/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-Shipping.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame.app/*" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-DebugGame" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/UnrealGame-Mac-Shipping" "${{ inputs.unreal-program-name }}/Engine/Binaries/Mac/*.dSYM"
df -h
rm ue.zip
df -h
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ jobs:
uses: ./.github/workflows/buildMac.yml
secrets: inherit
with:
runner-label: macos-12
runner-label: macos-13
unreal-engine-version: "5.4.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip"
unreal-program-name: "UE_5.4"
Expand All @@ -330,7 +330,7 @@ jobs:
uses: ./.github/workflows/buildiOS.yml
secrets: inherit
with:
runner-label: macos-12
runner-label: macos-13
unreal-engine-version: "5.4.0"
unreal-engine-zip: "s3://cesium-unreal-engine/5.4.0/UE_54_macOS.zip"
unreal-program-name: "UE_5.4"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildMac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
unreal-engine-zip: ${{ inputs.unreal-engine-zip }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
unreal-program-name: ${{ inputs.unreal-program-name }}
- name: Set environment variables
run: |
export CESIUM_UNREAL_VERSION=$GITHUB_REF_NAME
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/buildiOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
unreal-engine-zip: ${{ inputs.unreal-engine-zip }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
unreal-program-name: ${{ inputs.unreal-program-name }}
- name: Build cesium-native
run: |
mkdir -p extern/build-ios
Expand Down
11 changes: 8 additions & 3 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ endif()

option(CESIUM_USE_UNREAL_TRACING "Whether to trace cesium-native events using Unreal's tracing framework.")
if (CESIUM_USE_UNREAL_TRACING)
# Trace Cesium Native with Unreal Insights. Need to include Unreal Engine headers when building
# Trace Cesium Native with Unreal Insights. Need to include Unreal Engine headers when building
# Cesium Native.

# Change this line to change engine version. Note you will have to set an environment variable to
# the engine directory manually - or you can hardcode the directory here.
set(UNREAL_ENGINE_DIR $ENV{UE427})
list(APPEND CESIUM_EXTRA_INCLUDES "${UNREAL_ENGINE_DIR}/Engine/Source/Runtime/TraceLog/Public")
list(APPEND CESIUM_EXTRA_INCLUDES "${UNREAL_ENGINE_DIR}/Engine/Source/Runtime/Core/Public")
# Change this line depending on where your project's PCH is.
# Change this line depending on where your project's PCH is.
list(APPEND CESIUM_EXTRA_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../Intermediate/Build/Win64/UnrealEditor/Development/CesiumRuntime")
# Let Cesium Native know that we are tracing and overriding the default tracing macros.
add_compile_definitions(CESIUM_TRACING_ENABLED)
add_compile_definitions(CESIUM_OVERRIDE_TRACING)

# Overrides Cesium Native's macro definitions with Unreal Insights macros.
# Overrides Cesium Native's macro definitions with Unreal Insights macros.
# This allows us to trace Unreal, Cesium for Unreal, and Cesium Native all in Unreal Insights.
list(APPEND CESIUM_EXTRA_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include")
endif()
Expand All @@ -108,6 +108,11 @@ if (ANDROID OR IOS)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mikktspace
)

if (IOS)
# ktx tags itself as a FRAMEWORK on iOS, which causes linker errors. Undo that.
set_target_properties(ktx PROPERTIES FRAMEWORK FALSE)
endif()
endif()

option(BUILD_SHARED_LIB OFF)
Expand Down

0 comments on commit e06e36b

Please sign in to comment.