There are some possible troubles:
You may need to include the gem dependency in your gem's cmakelists.
Like so:
ly_add_target(
NAME ${gem_name}.Private.Object STATIC
NAMESPACE Gem
FILES_CMAKE
gs_audio_private_files.cmake
${pal_dir}/gs_audio_private_files.cmake
TARGET_PROPERTIES
O3DE_PRIVATE_TARGET TRUE
INCLUDE_DIRECTORIES
PRIVATE
Include
Source
${LY_ROOT_FOLDER}/Gems/MiniAudio/Code/Source/Clients
BUILD_DEPENDENCIES
PUBLIC
AZ::AzCore
AZ::AzFramework
Gem::LmbrCentral
Gem::GS_Core.API
Gem::MiniAudio.API
PRIVATE
3rdParty::miniaudio
3rdParty::miniaudio_libvorbis
3rdParty::miniaudio_reverb_node
)
For the debug draw: You may need to decouple your component into a runtime component, and an editortime component. As the editor targets have dependencies for AzToolsFramework and other engine-only code. This is why there's a GemModule, and GemEditorModule.
ly_add_target(
NAME ${gem_name}.Editor.Private.Object STATIC
NAMESPACE Gem
FILES_CMAKE
gs_audio_editor_private_files.cmake
TARGET_PROPERTIES
O3DE_PRIVATE_TARGET TRUE
INCLUDE_DIRECTORIES
PRIVATE
Include
Source
BUILD_DEPENDENCIES
PUBLIC
AZ::AzToolsFramework
Gem::${gem_name}.Private.Object
Gem::GS_Core.API
)