diff --git a/packages/react-native-audio-api/android/build.gradle b/packages/react-native-audio-api/android/build.gradle index e2b8442a8..b46b11c9e 100644 --- a/packages/react-native-audio-api/android/build.gradle +++ b/packages/react-native-audio-api/android/build.gradle @@ -308,9 +308,14 @@ def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask { } task downloadPrebuiltBinaries(type: Exec) { - commandLine 'chmod', '+x', '../scripts/download-prebuilt-binaries.sh' - commandLine 'bash', '../scripts/download-prebuilt-binaries.sh' - args 'android', isFFmpegDisabled() ? 'skipffmpeg' : '' + def isWindows = Os.isFamily(Os.FAMILY_WINDOWS) + if (isWindows) { + commandLine 'C:\\Program Files\\Git\\usr\\bin\\bash.exe', '../scripts/download-prebuilt-binaries.sh', 'android', isFFmpegDisabled() ? 'skipffmpeg' : '' + } else { + commandLine 'chmod', '+x', '../scripts/download-prebuilt-binaries.sh' + commandLine 'bash', '../scripts/download-prebuilt-binaries.sh' + args 'android', isFFmpegDisabled() ? 'skipffmpeg' : '' + } } // Make preBuild depend on the download task diff --git a/packages/react-native-audio-api/android/src/main/cpp/audioapi/CMakeLists.txt b/packages/react-native-audio-api/android/src/main/cpp/audioapi/CMakeLists.txt index b96e3f282..f533ea1be 100644 --- a/packages/react-native-audio-api/android/src/main/cpp/audioapi/CMakeLists.txt +++ b/packages/react-native-audio-api/android/src/main/cpp/audioapi/CMakeLists.txt @@ -1,8 +1,21 @@ cmake_minimum_required(VERSION 3.12.0) -file(GLOB_RECURSE ANDROID_CPP_SOURCES CONFIGURE_DEPENDS "${ANDROID_CPP_DIR}/audioapi/*.cpp") -file(GLOB_RECURSE COMMON_CPP_SOURCES CONFIGURE_DEPENDS "${COMMON_CPP_DIR}/audioapi/*.cpp" "${COMMON_CPP_DIR}/audioapi/*.c") -file(GLOB_RECURSE DSP_CPP_SOURCES CONFIGURE_DEPENDS "${COMMON_CPP_DIR}/audioapi/dsp/*.cpp") +file(GLOB_RECURSE ANDROID_CPP_SOURCES_ABS CONFIGURE_DEPENDS "${ANDROID_CPP_DIR}/audioapi/*.cpp") +file(GLOB_RECURSE COMMON_CPP_SOURCES_ABS CONFIGURE_DEPENDS "${COMMON_CPP_DIR}/audioapi/*.cpp" "${COMMON_CPP_DIR}/audioapi/*.c") +file(GLOB_RECURSE DSP_CPP_SOURCES_ABS CONFIGURE_DEPENDS "${COMMON_CPP_DIR}/audioapi/dsp/*.cpp") + +foreach(src IN LISTS ANDROID_CPP_SOURCES_ABS) + file(RELATIVE_PATH rel_src "${CMAKE_CURRENT_SOURCE_DIR}" "${src}") + list(APPEND ANDROID_CPP_SOURCES "${rel_src}") +endforeach() +foreach(src IN LISTS COMMON_CPP_SOURCES_ABS) + file(RELATIVE_PATH rel_src "${CMAKE_CURRENT_SOURCE_DIR}" "${src}") + list(APPEND COMMON_CPP_SOURCES "${rel_src}") +endforeach() +foreach(src IN LISTS DSP_CPP_SOURCES_ABS) + file(RELATIVE_PATH rel_src "${CMAKE_CURRENT_SOURCE_DIR}" "${src}") + list(APPEND DSP_CPP_SOURCES "${rel_src}") +endforeach() if (RN_AUDIO_API_FFMPEG_DISABLED) list(REMOVE_ITEM COMMON_CPP_SOURCES