Skip to content

Commit 39bbf9b

Browse files
tkothadevTJ Kotha
andauthored
iOS MiniAudio Gem Compilation fixes (o3de#17488)
* added fixes for mini audio gem so that it compiles for ios. Template updated to remove AWSCore Signed-off-by: TJ Kotha <[email protected]> * minor fixes Signed-off-by: TJ Kotha <[email protected]> --------- Signed-off-by: TJ Kotha <[email protected]> Co-authored-by: TJ Kotha <[email protected]>
1 parent c437120 commit 39bbf9b

File tree

8 files changed

+60
-1
lines changed

8 files changed

+60
-1
lines changed

Gems/MiniAudio/Code/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ ly_add_target(
4242
FILES_CMAKE
4343
miniaudio_private_files.cmake
4444
${pal_dir}/miniaudio_private_files.cmake
45+
PLATFORM_INCLUDE_FILES
46+
${pal_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
4547
TARGET_PROPERTIES
4648
O3DE_PRIVATE_TARGET TRUE
4749
INCLUDE_DIRECTORIES
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) Contributors to the Open 3D Engine Project.
3+
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0 OR MIT
6+
#
7+
#
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) Contributors to the Open 3D Engine Project.
3+
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0 OR MIT
6+
#
7+
#
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) Contributors to the Open 3D Engine Project.
3+
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0 OR MIT
6+
#
7+
#
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#
2+
# Copyright (c) Contributors to the Open 3D Engine Project.
3+
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0 OR MIT
6+
#
7+
#
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Copyright (c) Contributors to the Open 3D Engine Project.
3+
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
4+
#
5+
# SPDX-License-Identifier: Apache-2.0 OR MIT
6+
#
7+
#
8+
9+
find_library(AV_FOUNDATION_LIBRARY AVFoundation)
10+
find_library(AUDIO_TOOLBOX_GRAPHICS_LIBRARY AudioToolbox)
11+
find_library(CORE_AUDIO_SERVICES_LIBRARY CoreAudio)
12+
find_library(FOUNDATION_LIBRARY Foundation)
13+
14+
set(LY_BUILD_DEPENDENCIES
15+
PRIVATE
16+
${AV_FOUNDATION_LIBRARY}
17+
${AUDIO_TOOLBOX_GRAPHICS_LIBRARY}
18+
${CORE_AUDIO_SERVICES_LIBRARY}
19+
${FOUNDATION_LIBRARY}
20+
)
21+
22+
add_compile_definitions(MA_NO_RUNTIME_LINKING=1)
23+
24+
ly_add_source_properties(
25+
SOURCES Source/Clients/MiniAudioImplementation.cpp
26+
PROPERTY COMPILE_OPTIONS
27+
VALUES -xobjective-c++
28+
)

Gems/MiniAudio/Code/Source/Clients/MiniAudioImplementation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ extern "C" {
1919

2020
#define STB_VORBIS_HEADER_ONLY
2121
#include <stb_vorbis.c> // Enables Vorbis decoding.
22+
}
2223

2324
#define MINIAUDIO_IMPLEMENTATION
2425
#include <miniaudio.h>
2526

27+
extern "C" {
2628
// The stb_vorbis implementation must come after the implementation of miniaudio.
2729
#undef STB_VORBIS_HEADER_ONLY
2830
#include <stb_vorbis.c>

Templates/DefaultProject/Template/project.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"${Name}",
2323
"Atom",
2424
"AudioSystem",
25-
"AWSCore",
2625
"CameraFramework",
2726
"DebugDraw",
2827
"DiffuseProbeGrid",

0 commit comments

Comments
 (0)