googlearchive / android-audio-high-performance

We now recommend you use the Oboe libraries:
https://github.com/google/oboe
Apache License 2.0
719 stars 275 forks source link

Fresh clone fails with CMake #100

Closed ghost closed 6 years ago

ghost commented 6 years ago

A fresh clone causes this error when trying to run the hello-oboe project:

CMake Error at CMakeLists.txt:42 (add_subdirectory): add_subdirectory given source "C:/projects/android-audio-high-performance/oboe/lib-oboe" which is not an existing directory. -- Configuring incomplete, errors occurred!

dturner commented 6 years ago

Thanks for letting us know. I'm presuming from your path that you're on a Windows machine. I've tested on a Mac running OSX 10.13.2 and was unable to replicate.

It could be that the part of the CMakeLists.txt which automatically clones the Oboe library is failing on Windows:

### INCLUDE OBOE LIBRARY ###

# Set the path to the Oboe library directory (may not exist yet)
set (OBOE_RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../lib-oboe)

# Get the absolute path to the Oboe library directory
get_filename_component(OBOE_DIR
                       ${OBOE_RELATIVE_PATH}
                       ABSOLUTE)

# If the Oboe library directory doesn't exist, clone it from github
if ((NOT EXISTS ${OBOE_DIR}) OR
    (NOT EXISTS ${OBOE_DIR}/CMakeLists.txt))
    execute_process(COMMAND git clone
                            https://github.com/google/oboe.git
                            ${OBOE_DIR}
                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
endif()

# Add the Oboe library as a subproject. Since Oboe is an out-of-tree source library we must also
# specify a binary directory
add_subdirectory(${OBOE_DIR} ./oboe)

Adding Gerry who might know of a fix.

Whilst we investigate a fix you can work around this problem by cloning oboe manually by doing:

cd C:/projects/android-audio-high-performance/oboe/
git clone https://github.com/google/oboe.git lib-oboe
ggfan commented 6 years ago

@jmalsoftware, may you add more details, things like the steps you are using ( from clone to build project )? tried twice on Windows 10: it builds and runs fine. But my windows machine is very slow, hope that is not the reason to make it pass.

Please update and I will take one more look. thanks.
my steps:

assuming you have SDK/NDK all downloaded, and using Android Studio's CMake ( not the standalong CMake )

ggfan commented 6 years ago

@jamlsoftware, just ping to see if you get chance to try it out again; kindly update us here. thx

ggfan commented 6 years ago

closing this one as I could not see it. please re-open it if you still see the problem. Thx